[C++-sig] Inserting custom code into pyplusplus output

Niall Douglas s_sourceforge at nedprod.com
Fri Jun 16 19:37:46 CEST 2006


On 15 Jun 2006 at 21:08, Roman Yakovenko wrote:

> > No, this appends into TnFOX.main.cpp. I need it appended into
> > FXApp.pypp.cpp. If you examine file_writers/multiple_files.py, you
> > can see it writes license, precompiled header, global headers, global
> > namespace aliases, wrapper classes and the register function for the
> > class in question. Nowhere is it letting you write custom text
> > outside the bodies of these items. I suppose you could add a custom
> > form of wrapper code creator, but this seems inflexible - you should
> > be able to insert text anywhere in any output file.
> 
> :-). This is one of my big problems - I don't know what interface to
> give to the user.
> It is not very difficult to implement what you are asking for.  I am
> sure you have an
> idea, right ?

I was thinking that you should replace the wrapper property in 
class_t with a more generic code_creators, of which one is the 
wrapper class (if needed). Call it 'classfilecreators' or something. 
Then to add things per class file, you simply adopt a custom text 
creator into it.

You'd need to be careful when using the single file writer as some 
items may duplicate. Of course, this is probably an end user problem.

> As a temporal solution you can create custom file writer. Or may be to write
> small script that will add the code to the file.

I'll wait for your solution and use diff and patch in the meantime.

Cheers,
Niall






More information about the Cplusplus-sig mailing list