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

Roman Yakovenko roman.yakovenko at gmail.com
Thu Jun 15 20:08:07 CEST 2006


On 6/15/06, Niall Douglas <s_sourceforge at nedprod.com> wrote:
> On 15 Jun 2006 at 8:55, Roman Yakovenko wrote:
>
> > If you want to insert a code in some specific place, then :
> >
> > module.body.adopt_creator( code_creators.custom_text_t( ... ), position )
> > ( By default the code creator will be appended to the end of the list )
>
> 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 ?

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.

--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list