On Wed, 10 Oct 2012 20:12:36 -0700 Tim Roberts <t...@probo.com> wrote:
> Jean-Michel Pichavant <jeanmic...@sequans.com> wrote: > > > >I'm trying to generate C++ code from an XML file. I'd like to use a template > >engine, which imo produce something readable and maintainable. > >My google search about this subject has been quite unsuccessful, I've been > >redirected to template engine specific to html mostly. > > > >Does anybody knows a python template engine for generating C++ code ? > > I'm a big fan of Cheetah. It's simple but flexible enough to be useful. > Besides the many web projects I've done with it, I also I use it in one > project to generate PHP code (it generates data access objects from a live > database schema). > -- > Tim Roberts, t...@probo.com > Providenza & Boekelheide, Inc. > -- > http://mail.python.org/mailman/listinfo/python-list Also take a look at IDL, for a proper way to handle interface generation in C++. No python or cheetah required as by definition your interfaces should be portable. What your describing is more or less look like a hack or something which would be a pain to maintain without SWIG or something more suited for this purposes than XML. http://en.wikipedia.org/wiki/Interface_description_language http://en.wikipedia.org/wiki/SWIG -- http://mail.python.org/mailman/listinfo/python-list