<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to HowTo</title><link>https://sourceforge.net/p/xml-cpp-class-generator/wiki/HowTo/</link><description>Recent changes to HowTo</description><atom:link href="https://sourceforge.net/p/xml-cpp-class-generator/wiki/HowTo/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 13 Mar 2015 07:17:23 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/xml-cpp-class-generator/wiki/HowTo/feed" rel="self" type="application/rss+xml"/><item><title>HowTo modified by Anonymous</title><link>https://sourceforge.net/p/generatecppfomxml/wiki/HowTo/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;a class="" href="/p/generatecppfomxml/wiki/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;Usage&lt;/li&gt;
&lt;li&gt;More documentation&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;The package can be retrieved either from the svn repository: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;svn&lt;/span&gt; &lt;span class="n"&gt;checkout&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//xml-cpp-class-generator.googlecode.com/svn/trunk/ MyClassGenerator&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or from the &lt;a class="" href="http://code.google.com/p/xml-cpp-class-generator/downloads/list" rel="nofollow"&gt;downloads page&lt;/a&gt;. and should be installed like this: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt; &lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="n"&gt;MyClassGenerator&lt;/span&gt; 
 &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;configure&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;
 &lt;span class="n"&gt;make&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;NB: the prefix (/usr in the given example) should correspond to where the python modules should be installed. On many distributions it is &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;packages&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;whilst the default prefix is usually /usr/local, which will not work. &lt;/p&gt;
&lt;p&gt;Once this is done, it can be run by calling &lt;code&gt;GenerateFiles.py&lt;/code&gt; from anywhere (be sure you run &lt;code&gt;rehash&lt;/code&gt; on your (t)csh or zsh already opened shells). &lt;/p&gt;
&lt;p&gt;I found a proper way to configure a local installation: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt; &lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="n"&gt;MyClassGenerator&lt;/span&gt; 
 &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;configure&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;enable&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt; 
 &lt;span class="n"&gt;make&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This allows to run the package like this: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt; &lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="n"&gt;MyClassGenerator&lt;/span&gt; 
 &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;GenerateFiles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a class="" href="/p/generatecppfomxml/wiki/HowTo"&gt;Back on top&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="usage"&gt;Usage&lt;/h1&gt;
&lt;p&gt;From now onwards, it is assumed that MyClassDescription.xml, a valid XML class description file (as described here), is present in the directory. &lt;/p&gt;
&lt;p&gt;First, help is provided by the executable script itself, when using the &lt;code&gt;-h&lt;/code&gt; or &lt;code&gt;--help&lt;/code&gt; argument: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;GenerateFiles&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;py&lt;/span&gt; &lt;span class="o"&gt;[-&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[-&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[-&lt;/span&gt;&lt;span class="n"&gt;H&lt;/span&gt; &lt;span class="n"&gt;HEADEREXT&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[-&lt;/span&gt;&lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;IMPLEXT&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[-&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="n"&gt;OUTPUTDIR&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
                         &lt;span class="o"&gt;[-&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="n"&gt;LANG&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[-&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="n"&gt;LEVEL1&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="n"&gt;LEVEL2&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
                         &lt;span class="n"&gt;F&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt; &lt;span class="o"&gt;...]&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Generates C++ classes from a class description read from a XML file. &lt;/p&gt;
&lt;p&gt;positional arguments: F XML file(s) to be read &lt;/p&gt;
&lt;p&gt;optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit -H HEADEREXT, --header HEADEREXT extension for header files (default: .hpp) -I IMPLEXT, --impl IMPLEXT extension for implementation files (default: .cpp) -d OUTPUTDIR, --directory OUTPUTDIR destination directory (default: ./) -l LANG, --language LANG sets the output language (default: en) -t, --translation shows available translations and exits -n, --noout disables the file production, will just check syntax (default: False) -1 LEVEL1, --level1 LEVEL1 sets output level for the interpretor class (default: 3) -2 LEVEL2, --level2 LEVEL2 sets output level for the main script (default: 3) &lt;/p&gt;
&lt;p&gt;This help and the argument processing are done by the &lt;a class="" href="http://docs.python.org/dev/library/argparse.html" rel="nofollow"&gt;argparse&lt;/a&gt; python module. &lt;/p&gt;
&lt;p&gt;In order to get the output files in &lt;code&gt;my_output_dir&lt;/code&gt;, the following command line has to be typed: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt; &lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="n"&gt;MyClassGenerator&lt;/span&gt; 
 &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;GenerateFiles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt; &lt;span class="n"&gt;MyClassDescription&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="n"&gt;my_output_dir&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;-1&lt;/code&gt; and &lt;code&gt;-2&lt;/code&gt; arguments control the verbosity of the running, &lt;code&gt;-l&lt;/code&gt; sets the output language (the ISO-639-1 language code), defaults to en (i.e. english) if nothing is given or if the wanted translation does not exist. A list of available translations is printed when using &lt;code&gt;-t&lt;/code&gt; argument. &lt;/p&gt;
&lt;p&gt;&lt;a class="" href="/p/generatecppfomxml/wiki/HowTo"&gt;Back on top&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="more-documentation"&gt;More documentation&lt;/h1&gt;
&lt;p&gt;All the python modules are documented, the pdf manual can be created using &lt;a class="" href="http://www.stack.nl/~dimitri/doxygen" rel="nofollow"&gt;doxygen&lt;/a&gt; on the provided doxyfile in &lt;code&gt;Documentation/&lt;/code&gt;. The documentation can also be generated by using &lt;code&gt;make documentation&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;&lt;a class="" href="/p/generatecppfomxml/wiki/HowTo"&gt;Back on top&lt;/a&gt;&lt;/p&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:23 -0000</pubDate><guid>https://sourceforge.netaab2607aa62a57d7e63a0166ee8d1f319b358400</guid></item></channel></rss>