[pygccxml-commit] source/pyplusplus/experimental decltypes.py,1.1,1.2
Brought to you by:
mbaas,
roman_yakovenko
From: Matthias B. <mb...@us...> - 2006-04-06 09:22:17
|
Update of /cvsroot/pygccxml/source/pyplusplus/experimental In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19304 Modified Files: decltypes.py Log Message: Added a class 'cpp' that allows to specify C++ source code as default value in an 'arg' statement. Index: decltypes.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/experimental/decltypes.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** decltypes.py 14 Mar 2006 10:25:11 -0000 1.1 --- decltypes.py 6 Apr 2006 09:22:07 -0000 1.2 *************** *** 21,24 **** --- 21,41 ---- CALLABLE = METHOD | FUNCTION | CONSTRUCTOR + # cpp + class cpp: + """This class wraps C++ source code for default values. + + This class is used together with the 'arg' class to provide + C++ source code as default value. Example: + + method.cdef("foo", "&Foo::foo", arg("ptr", cpp("bp::object()"))) + + The cpp class prevents the generation of apostrophes (as it would + happen when only a string would be passed). + """ + def __init__(self, src): + self.src = src + + def __str__(self): + return self.src # arg |