<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to MainPage</title><link>https://sourceforge.net/p/xml-cpp-class-generator/wiki/MainPage/</link><description>Recent changes to MainPage</description><atom:link href="https://sourceforge.net/p/xml-cpp-class-generator/wiki/MainPage/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 13 Mar 2015 07:17:20 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/xml-cpp-class-generator/wiki/MainPage/feed" rel="self" type="application/rss+xml"/><item><title>MainPage modified by Anonymous</title><link>https://sourceforge.net/p/generatecppfomxml/wiki/MainPage/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;a class="" href="../WikiMap"&gt;Navigate through the wiki&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Package contents&lt;ul&gt;
&lt;li&gt;XmlCppClassGenerator contents&lt;/li&gt;
&lt;li&gt;List of xml files&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Help on the package&lt;/li&gt;
&lt;li&gt;Requirements&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;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 &lt;a class="" href="../ExamplesOutput"&gt;here&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;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 &lt;a class="" href="../XmlFileContent"&gt;XML file description page&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;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. &lt;/p&gt;
&lt;h1 id="package-contents"&gt;Package contents&lt;/h1&gt;
&lt;p&gt;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. &lt;/p&gt;
&lt;h2 id="xmlcppclassgenerator-contents"&gt;XmlCppClassGenerator contents&lt;/h2&gt;
&lt;p&gt;The XmlCppClassGenerator module consists of four related submodules : &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a module defining python classes, each of them representing various objects found in a C++ class definition, like method, argument, member, ... &lt;/li&gt;
&lt;li&gt;a module defining a customisable output messaging service, allowing to put debug, warning statements in the code, which can be enabled or disabled at runtime. &lt;/li&gt;
&lt;li&gt;a module responsible for providing character strings depending on the wanted language (used for class generation and output in the terminal). &lt;/li&gt;
&lt;li&gt;a module responsible for the XML reading and creation of the representation of the C++ class, this object being used to generate both header and implementation file. &lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="list-of-xml-files"&gt;List of xml files&lt;/h2&gt;
&lt;p&gt;The XmlCppClassGeneratorInfo directory contains: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the XML schema file XmlCppClassGenerator.xsd describing the structure of the XML file containing the class description. &lt;/li&gt;
&lt;li&gt;the XML schema file Languages.xsd, which describes the structure of the translation file. &lt;/li&gt;
&lt;li&gt;the XML file Translations.xml, which contains the translations (at the moment english and french are implemented). &lt;/li&gt;
&lt;li&gt;the XML schema file Statements.xsd, which describes the structure of the file containing C++ statements (basically method bodies). &lt;/li&gt;
&lt;li&gt;the XML file Bodies.xml, which contains the bodies of the different methods. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="help-on-the-package"&gt;Help on the package&lt;/h1&gt;
&lt;p&gt;How to run the package is explain on the &lt;a class="" href="../HowTo"&gt;how to&lt;/a&gt; page. &lt;/p&gt;
&lt;p&gt;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 &lt;a class="" href="../XmlFileContent"&gt;this page&lt;/a&gt; is given a full example of a valid XML file. &lt;/p&gt;
&lt;p&gt;The translation file (contents, how to write it, ...) is described in &lt;a class="" href="../XmlTranslationFile"&gt;this page&lt;/a&gt;. With the given information you will be able to add your favourite language to the package. &lt;/p&gt;
&lt;p&gt;Finally, information on the XML file providing the method bodies are given in &lt;a class="" href="../XmlStatementFile"&gt;here&lt;/a&gt;. &lt;/p&gt;
&lt;h1 id="requirements"&gt;Requirements&lt;/h1&gt;
&lt;p&gt;The requirements are checked when the installation is performed, by the dedicated &lt;code&gt;./configure&lt;/code&gt; script. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;libxml2-utils for xmllint (XML validation program) is needed. &lt;/li&gt;
&lt;li&gt;the needed python modules are provided by the standard python package (version 2.7 and later), namely : &lt;ul&gt;
&lt;li&gt;minidom &lt;/li&gt;
&lt;li&gt;codecs &lt;/li&gt;
&lt;li&gt;subprocess &lt;/li&gt;
&lt;li&gt;argparse &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Fri, 13 Mar 2015 07:17:20 -0000</pubDate><guid>https://sourceforge.netca45dc21d3af76cc8a0954868a6a5ae1c411d768</guid></item></channel></rss>