This package aims at producing nice header and implementation files for C++ classes and structures. Being a C++ developer myself, I like to have my class members to be private or protected, meaning that set/get methods have to be written. I also try to add meaningful comments, which becomes a pain in the neck when class A has around 20 protected members. I tried then to find a way to automatically build the header and implementation files from a generic class description. I didn't find anything fulfilling my purpose, then I decided to code it myself. Some examples can be found here.
I work a lot with XML files, they have the advantage to be both human and machine readable. This is why the class description is written in a XML file. This file contains information about the class name, its author, the constructors and methods (with their arguments), the members, parent class(es), etc. A complete description can be found in the XML file description page.
Since the package has to deal with string manipulation, my first idea was to use Perl, but the class hierarchy I needed was more compatible with Python. Moreover, the xml.dom.minidom python module makes XML manipulation easy. Therefore the chosen language for this package is Python.
The package consists of two parts: the python module XmlCppClassGenerator and a directory (XmlCppClassGeneratorInfo) containing the XML schema describing the structure of the XML class file, a translation XML file with the corresponding XML schema file.
The XmlCppClassGenerator module consists of four related submodules :
The XmlCppClassGeneratorInfo directory contains:
How to run the package is explain on the how to page.
Since the class you want to create has to be described in a XML file, the structure of this XML file has to be described. In this page is given a full example of a valid XML file.
The translation file (contents, how to write it, ...) is described in this page. With the given information you will be able to add your favourite language to the package.
Finally, information on the XML file providing the method bodies are given in here.
The requirements are checked when the installation is performed, by the dedicated ./configure
script.
Wiki: ExamplesOutput
Wiki: HowTo
Wiki: WikiMap
Wiki: XmlFileContent
Wiki: XmlStatementFile
Wiki: XmlTranslationFile