[C++-sig] pyplusplus tutorials & GUI wizard
Matthias Baas
baas at ira.uka.de
Mon Jan 30 16:04:36 CET 2006
Roman Yakovenko wrote:
>> Now I have an output file that contains some stuff, a lot of stuff
>> indeed! Now the question is, how do I reduce this stuff? What filter do
>> I have to use? Basically, for now I only want one single class that's
>> inside that namespace. So how I can tell pyplusplus to only wrap that
>> specific class?
>
> take a look on http://tinyurl.com/9uhv4 or http://tinyurl.com/e44kh.
> see filter_declarations method. This should help, if not please speak.
ok. I'm using a custom filter function now that rejects everything
except my desired class. The test is based on decl.name (by the way, a
reference manual where the attributes and methods of those declaration
objects are documented would come in rather handy at this point ;)
So far so good...
>> Another thing I noticed, the header files included in the output file
>> are specified with their *absolute* path (even standard header files).
>> Is this intentional or is this a bug? I'd recommend to output the header
>> names just as they were specified in the original files. Currently, this
>> prevents me from taking the generated source files to another system and
>> compile them there.
>
> May be there is some problem with standard header files. But pyplusplus is
> flexible enough to allow you to specify additional include directories:
>
> code_creators.module_t has 2 properties:
>
> std_directories
> user_defined_directories.
>
> You can add your include directories to user_defined_directories list.
Right, after adding the paths to 'user_defined_directories' the #include
statements look good.
(It's a bit unfortunate that I have to pass the path information twice
in my script (once for parser_config and once for the above attribute).
It would be nice if the information could be reused.)
I extended my test and already added more than one class and tried the
write_multiple_files() function. Basically, it works fine, but one
problem still remains: The output files will only compile if I include
some additional header files (which actually depend on the class I'm
wrapping). So how do I tell pyplusplus to add those headers to the
output files? (in Pyste I was using the declaration_code() function)
- Matthias -
More information about the Cplusplus-sig
mailing list