[Synopsis-changes] Synopsis/Synopsis/tests/Cxx-API/Python/src List.cc,1.1,1.2 Object.cc,1.1,1.2
Stefan Seefeld stefan at synopsis.fresco.orgWed Jan 14 04:04:56 UTC 2004
- Previous message: [Synopsis-changes] Synopsis/Synopsis/tests/Cxx-API/Python/expected List.out,1.1,1.2
- Next message: [Synopsis-changes] Synopsis/Synopsis/tests/qmtest/classes classes.qmc,1.1,1.2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Update of /cvs/synopsis/Synopsis/tests/Cxx-API/Python/src
In directory frida:/tmp/cvs-serv17083/tests/Cxx-API/Python/src
Modified Files:
List.cc Object.cc
Log Message:
add List iterator
Index: List.cc
===================================================================
RCS file: /cvs/synopsis/Synopsis/tests/Cxx-API/Python/src/List.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -d -r1.1 -r1.2
--- List.cc 9 Jan 2004 20:03:26 -0000 1.1
+++ List.cc 14 Jan 2004 04:04:54 -0000 1.2
@@ -12,13 +12,16 @@ void test1()
list.append(1);
list.append("hello");
list.append("world");
- std::cout << Object::narrow<const char *>(list.str()) << std::endl;
+ std::cout << Object::narrow<std::string>(list.str()) << std::endl;
list.sort();
- std::cout << Object::narrow<const char *>(list.str()) << std::endl;
+ std::cout << Object::narrow<std::string>(list.str()) << std::endl;
list.reverse();
- std::cout << Object::narrow<const char *>(list.str()) << std::endl;
+ std::cout << Object::narrow<std::string>(list.str()) << std::endl;
Object o = list.get(0);
- std::cout << Object::narrow<const char *>(o.str()) << std::endl;
+ std::cout << Object::narrow<std::string>(o.str()) << std::endl;
+
+ for (List::iterator i = list.begin(); i != list.end(); ++i)
+ std::cout << Object::narrow<std::string>(i->str()) << std::endl;
}
int main(int, char **)
Index: Object.cc
===================================================================
RCS file: /cvs/synopsis/Synopsis/tests/Cxx-API/Python/src/Object.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -d -r1.1 -r1.2
--- Object.cc 9 Jan 2004 20:03:26 -0000 1.1
+++ Object.cc 14 Jan 2004 04:04:54 -0000 1.2
@@ -10,13 +10,13 @@ void test1()
Object object;
Object character('q');
std::cout << Object::narrow<char>(character) << std::endl;
- std::cout << Object::narrow<const char *>(character.str()) << std::endl;
+ std::cout << Object::narrow<std::string>(character.str()) << std::endl;
Object string("hello world");
- std::cout << Object::narrow<const char *>(string) << std::endl;
- std::cout << Object::narrow<const char *>(string.str()) << std::endl;
+ std::cout << Object::narrow<std::string>(string) << std::endl;
+ std::cout << Object::narrow<std::string>(string.str()) << std::endl;
Object integer(42);
std::cout << Object::narrow<long>(integer) << std::endl;
- std::cout << Object::narrow<const char *>(integer.str()) << std::endl;
+ std::cout << Object::narrow<std::string>(integer.str()) << std::endl;
try { std::cout << Object::narrow<long>(string) << std::endl;}
catch (Object::TypeError &e) { std::cout << e.what() << std::endl;}
}
- Previous message: [Synopsis-changes] Synopsis/Synopsis/tests/Cxx-API/Python/expected List.out,1.1,1.2
- Next message: [Synopsis-changes] Synopsis/Synopsis/tests/qmtest/classes classes.qmc,1.1,1.2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Synopsis-changes mailing list