<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to XmlFileContent</title><link>https://sourceforge.net/p/xml-cpp-class-generator/wiki/XmlFileContent/</link><description>Recent changes to XmlFileContent</description><atom:link href="https://sourceforge.net/p/xml-cpp-class-generator/wiki/XmlFileContent/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/XmlFileContent/feed" rel="self" type="application/rss+xml"/><item><title>XmlFileContent modified by Anonymous</title><link>https://sourceforge.net/p/generatecppfomxml/wiki/XmlFileContent/</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;p&gt;&lt;strong&gt;Table of contents:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The XML class description file&lt;/li&gt;
&lt;li&gt;XML header and root element&lt;/li&gt;
&lt;li&gt;The class element node&lt;/li&gt;
&lt;li&gt;Concerning templates&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="the-xml-class-description-file"&gt;The XML class description file&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Nota bene&lt;/strong&gt;: The structure of the XML class description files is completely described by the XML schema file XmlCppClassGenerator.xsd file. In case there is an inconsistency between the aforementioned file and this page, the truth is &lt;em&gt;always&lt;/em&gt; contained in the XML schema file. &lt;/p&gt;
&lt;p&gt;This package uses a class description written in a XML file to generate header and implementation files. In this page are presented the structure of the XML file. In order to prevent errors when the C++ files are generated, the XML file is validated against the XML schema with &lt;code&gt;xmllint&lt;/code&gt;, and any error will be reported and the execution stopped. &lt;/p&gt;
&lt;p&gt;&lt;a class="" href="/p/generatecppfomxml/wiki/XmlFileContent"&gt;Back on top&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="xml-header-and-root-element"&gt;XML header and root element&lt;/h1&gt;
&lt;p&gt;Any XML class description file you define should look like the following example: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt; &lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="nt"&gt;xml&lt;/span&gt; &lt;span class="nt"&gt;version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"1.0"&lt;/span&gt; &lt;span class="nt"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"UTF-8"&lt;/span&gt;&lt;span class="o"&gt;?&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&amp;lt;classes xmlns="http://www.w3schools.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com !XmlCppClassGenerator.xsd"&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;classes&amp;gt;&lt;/p&gt;
&lt;p&gt;Note that the encoding is UTF-8, this cannot be changed &lt;em&gt;unless&lt;/em&gt; the Translations.xml file is changed as well and the default python encoding is set accordingly (I had a hard time setting python's encoding to UTF-8). &lt;/p&gt;
&lt;p&gt;In the &lt;code&gt;classes&lt;/code&gt; root element can be as many &lt;code&gt;class&lt;/code&gt; or &lt;code&gt;struct&lt;/code&gt; element nodes as wanted. &lt;/p&gt;
&lt;p&gt;&lt;a class="" href="/p/generatecppfomxml/wiki/XmlFileContent"&gt;Back on top&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="the-class-element-node"&gt;The &lt;code&gt;class&lt;/code&gt; element node&lt;/h1&gt;
&lt;p&gt;An example of class is given here below: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt; &lt;span class="nt"&gt;&amp;lt;class&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt; ExampleClass &lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;author&amp;gt;&lt;/span&gt; George C. Clark &lt;span class="nt"&gt;&amp;lt;/author&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;date&amp;gt;&lt;/span&gt; 27th November 2011 &lt;span class="nt"&gt;&amp;lt;/date&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;comments&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/comments&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;inherits&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;parent&amp;gt;&lt;/span&gt; std::string &lt;span class="nt"&gt;&amp;lt;/parent&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;/inherits&amp;gt;&lt;/span&gt;  
   &lt;span class="nt"&gt;&amp;lt;inherits&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;access&amp;gt;&lt;/span&gt; protected &lt;span class="nt"&gt;&amp;lt;/access&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;virtual/&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;parent&amp;gt;&lt;/span&gt; std::vector&lt;span class="ni"&gt;&amp;amp;lt;&lt;/span&gt; double &lt;span class="ni"&gt;&amp;amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;/parent&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;/inherits&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;include&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;file&amp;gt;&lt;/span&gt; string &lt;span class="nt"&gt;&amp;lt;/file&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;/include&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;include&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;file&amp;gt;&lt;/span&gt; vector &lt;span class="nt"&gt;&amp;lt;/file&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;header/&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;/include&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;include&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;file&amp;gt;&lt;/span&gt; iostream &lt;span class="nt"&gt;&amp;lt;/file&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;/include&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;usedNamesapce&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;namespace&amp;gt;&lt;/span&gt; std &lt;span class="nt"&gt;&amp;lt;/namespace&amp;gt;&lt;/span&gt;  
     &lt;span class="nt"&gt;&amp;lt;header/&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;/usedNamesapce&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;usedNamesapce&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;namespace&amp;gt;&lt;/span&gt; std &lt;span class="nt"&gt;&amp;lt;/namespace&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;/implementationNamespace&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;public&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;constructor&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;argument&amp;gt;&lt;/span&gt; 
         &lt;span class="nt"&gt;&amp;lt;type&amp;gt;&lt;/span&gt; unsigned &lt;span class="nt"&gt;&amp;lt;/type&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;const&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/true&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;ref&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/ref&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;default&amp;gt;&lt;/span&gt; 0 &lt;span class="nt"&gt;&amp;lt;/default&amp;gt;&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt; nbr &lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt; 
      &lt;span class="nt"&gt;&amp;lt;/argument&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;/constructor&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;copyConstructor&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/copyConstructor&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;affectationOperator/&amp;gt;&lt;/span&gt;     &lt;span class="nt"&gt;&amp;lt;comparisonOperator&amp;gt;&lt;/span&gt;     &lt;span class="nt"&gt;&amp;lt;destructor/&amp;gt;&lt;/span&gt;     &lt;span class="nt"&gt;&amp;lt;method&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;return&amp;gt;&lt;/span&gt;         &lt;span class="nt"&gt;&amp;lt;type&amp;gt;&lt;/span&gt; bool &lt;span class="nt"&gt;&amp;lt;/type&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;/return&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt; isGreaterThan &lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;argument&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;type&amp;gt;&lt;/span&gt; unsigned &lt;span class="nt"&gt;&amp;lt;/type&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;const&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/const&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;ptr&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/ptr&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;ref&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/ref&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt; testNbr &lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;/argument&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;/method&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;member&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;type&amp;gt;&lt;/span&gt; std::string &lt;span class="nt"&gt;&amp;lt;/type&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;static&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/static&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;value&amp;gt;&lt;/span&gt; &lt;span class="ni"&gt;&amp;amp;quot;&lt;/span&gt;Hello World!&lt;span class="ni"&gt;&amp;amp;quot;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;/value&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;stdGet&amp;gt;&lt;/span&gt; false &lt;span class="nt"&gt;&amp;lt;/stdGet&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;stdSet&amp;gt;&lt;/span&gt; false &lt;span class="nt"&gt;&amp;lt;/stdSet&amp;gt;&lt;/span&gt; 
       &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt; StupidMessage &lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;/member&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;/public&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;protected&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;member&lt;/span&gt; 
     &lt;span class="err"&gt;&amp;lt;type&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; int &lt;span class="nt"&gt;&amp;lt;/type&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;stdGet&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/stdGet&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;stdSet&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/stdSet&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;ptrGet&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;ptrGet&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;ptrSet&amp;gt;&lt;/span&gt; true &lt;span class="nt"&gt;&amp;lt;/ptrSet&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt; AnotherCounter &lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt; 
     &lt;span class="nt"&gt;&amp;lt;/member&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;/protected&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;private/&amp;gt;&lt;/span&gt; 
 &lt;span class="nt"&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The presented example illustrates many features of the structure. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The class &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;author&lt;/code&gt; are mandatory (and self-explanatory). &lt;/li&gt;
&lt;li&gt;The &lt;code&gt;date&lt;/code&gt; is the creation date, used in the comments, and is mandatory as well. &lt;/li&gt;
&lt;li&gt;The &lt;code&gt;comments&lt;/code&gt; element is not mandatory, and its default value is &lt;code&gt;true&lt;/code&gt;, i.e. doxyygen comments will be generated unless the element is present &lt;em&gt;and&lt;/em&gt; set to &lt;code&gt;false&lt;/code&gt;. An empty present element will result in the comments to be produced. &lt;/li&gt;
&lt;li&gt;The &lt;code&gt;inherits&lt;/code&gt; element(s) are optional, and defines the class's parents (in order of appearance). The parent object is specified in the mandatory &lt;code&gt;parent&lt;/code&gt; child node. The &lt;code&gt;inherits&lt;/code&gt; element has two optional child nodes: &lt;code&gt;access&lt;/code&gt; which set the access specifier can take the &lt;code&gt;public&lt;/code&gt; (default), &lt;code&gt;protected&lt;/code&gt; and &lt;code&gt;private&lt;/code&gt; values, and &lt;code&gt;virtual&lt;/code&gt; which defines whether the inheritance is virtual or not can take either the &lt;code&gt;false&lt;/code&gt; (default) or &lt;code&gt;true&lt;/code&gt; values. Please note that '&lt;code&gt;&amp;lt;&lt;/code&gt;' and '&lt;code&gt;&amp;gt;&lt;/code&gt;' characters &lt;em&gt;cannot&lt;/em&gt; appear in any xml valid element, they must be replaced by '&amp;amp;lt;' and '&amp;amp;gt;' respectively! If a &lt;code&gt;virtual&lt;/code&gt; child node is present and empty, then the inheritance relation is virtual. &lt;/li&gt;
&lt;li&gt;The optional &lt;code&gt;include&lt;/code&gt; element(s) has a mandatory child node &lt;code&gt;file&lt;/code&gt; which defines which &lt;code&gt;#include&lt;/code&gt; should be added in the produces files. It also has two optional child nodes: &lt;code&gt;local&lt;/code&gt; which alters the rendering of the &lt;code&gt;#include&lt;/code&gt; statement in the output files: &lt;code&gt;false&lt;/code&gt; (the default) uses &lt;code&gt;#include &amp;lt;foo&amp;gt;&lt;/code&gt; (as usually done for system headers), whilst &lt;code&gt;true&lt;/code&gt; uses &lt;code&gt;#include "foo.hpp"&lt;/code&gt; (as usually done for user headers) and &lt;code&gt;header&lt;/code&gt; which default is &lt;code&gt;false&lt;/code&gt; performs the inclusion in the implementation file. In case those elements are present and empty, the &lt;code&gt;true&lt;/code&gt; value is used. &lt;/li&gt;
&lt;li&gt;The optional &lt;code&gt;usedNamesapce&lt;/code&gt; element defines the &lt;code&gt;using namespace&lt;/code&gt; statements used. The namespace name is set in the mandatory child node &lt;code&gt;namespace&lt;/code&gt;. The optional child node &lt;code&gt;header&lt;/code&gt; (default value is &lt;code&gt;false&lt;/code&gt;) allows to use the namespace either in the header or the implementation file. There can be any number of these elements. &lt;/li&gt;
&lt;li&gt;The &lt;code&gt;public&lt;/code&gt; element is mandatory, and must &lt;em&gt;at least&lt;/em&gt; contain one child node. ment. It can contain as many &lt;code&gt;constructor&lt;/code&gt;, &lt;code&gt;method&lt;/code&gt; and &lt;code&gt;member&lt;/code&gt; children nodes. &lt;/li&gt;
&lt;li&gt;A &lt;code&gt;constructor&lt;/code&gt; element can contain as many &lt;code&gt;argument&lt;/code&gt; as wanted. &lt;/li&gt;
&lt;li&gt;An &lt;code&gt;argument&lt;/code&gt; element as two mandatory children &lt;code&gt;type&lt;/code&gt;, which is the type of the given argument (&lt;code&gt;int&lt;/code&gt;, &lt;code&gt;double&lt;/code&gt;, etc.) and &lt;code&gt;name&lt;/code&gt; which indicates the argument variable name. Four optional childrens are: &lt;code&gt;const&lt;/code&gt; which set on/off the constness of the argument (default is &lt;code&gt;false&lt;/code&gt;), &lt;code&gt;ref&lt;/code&gt; which tells if the argument is passed by value (&lt;code&gt;false&lt;/code&gt;, default) or by reference (&lt;code&gt;true&lt;/code&gt;), &lt;code&gt;ptr&lt;/code&gt; which tells whether the argument is a pointer (&lt;code&gt;true&lt;/code&gt;) or not (default), and &lt;code&gt;default&lt;/code&gt; which can be used to set a default value for the argument. &lt;/li&gt;
&lt;li&gt;The optional element &lt;code&gt;copyConstructor&lt;/code&gt; contains only one data value which can be either &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt; (default). When set to &lt;code&gt;true&lt;/code&gt; a copy constructor will be automatically added to the list of constructors, and its body will be written as well. There can be &lt;em&gt;at most&lt;/em&gt; one &lt;code&gt;copyConstructor&lt;/code&gt;element. If by chance it is present in several places (e.g. in &lt;code&gt;public&lt;/code&gt; and in &lt;code&gt;private&lt;/code&gt;), only the first occurrence will be taken into account. &lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The optional element &lt;code&gt;affectationOperator&lt;/code&gt; contains only one boolean data field too, with default value set to &lt;code&gt;false&lt;/code&gt;. When set to &lt;code&gt;true&lt;/code&gt; it triggers the addition of the affectation operator: &lt;/p&gt;
&lt;p&gt;MyClass&amp;amp; operator=( const MyClass &amp;amp; myClass );&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The body of the method is also automatically generated from the list of non static members. If by chance it is present in several places (e.g. in &lt;code&gt;public&lt;/code&gt; and in &lt;code&gt;private&lt;/code&gt;), only the first occurrence will be taken into account. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The optional element &lt;code&gt;comparisonOperator&lt;/code&gt; contains as well only one boolean data field, with default value &lt;code&gt;false&lt;/code&gt;. It triggers the addition of a comparison method: &lt;/p&gt;
&lt;p&gt;bool operator==( const MyClass &amp;amp; myClass ) const;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Again the method body is generated automatically. If by chance it is present in several places (e.g. in &lt;code&gt;public&lt;/code&gt; and in &lt;code&gt;private&lt;/code&gt;), only the first occurrence will be taken into account. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;destructor&lt;/code&gt; empty child node can be added too, which triggers the addition of a virtual destructor to the object. Once more if such a child node is present in multiple places, only the first occurence will be taken into account. If the object is a &lt;em&gt;class&lt;/em&gt; and &lt;em&gt;no&lt;/em&gt; destructor was manually added, a public one will automatically be added to the class definition. The &lt;code&gt;destructor&lt;/code&gt; child node must appears &lt;em&gt;just after&lt;/em&gt; the &lt;code&gt;constructor&lt;/code&gt; ones (or first if no &lt;code&gt;constructor&lt;/code&gt; nodes are present). &lt;/li&gt;
&lt;li&gt;A &lt;code&gt;method&lt;/code&gt; has mandatory &lt;code&gt;return&lt;/code&gt; and &lt;code&gt;name&lt;/code&gt; elements, defining the return type and the method name. It can have as many &lt;code&gt;argument&lt;/code&gt; elements as desired, and has an optional &lt;code&gt;const&lt;/code&gt; element, which sets the &lt;code&gt;const&lt;/code&gt; switch of the method (a &lt;code&gt;const&lt;/code&gt; method cannot modify the calling instance members), which default value is &lt;code&gt;false&lt;/code&gt;. Other boolean optional elements are &lt;code&gt;static&lt;/code&gt;, &lt;code&gt;virtual&lt;/code&gt; and &lt;code&gt;pureVirtual&lt;/code&gt;, all of them having &lt;code&gt;false&lt;/code&gt; as default value, and indicate if the method is static, virtual or pure virtual. &lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;return&lt;/code&gt; element has as one mandatory child node &lt;code&gt;type&lt;/code&gt; which is the type of the returned variable (&lt;code&gt;int&lt;/code&gt;, &lt;code&gt;void&lt;/code&gt;, etc.) and four optional ones: &lt;code&gt;const&lt;/code&gt; which set on/off the constness of the returned value (default is &lt;code&gt;false&lt;/code&gt;), &lt;code&gt;ref&lt;/code&gt; which tells if the returned value is passed by value (&lt;code&gt;false&lt;/code&gt;, default) or by reference (&lt;code&gt;true&lt;/code&gt;), and &lt;code&gt;ptr&lt;/code&gt; which tells whether the returned value is a pointer (&lt;code&gt;true&lt;/code&gt;) or not (default). &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A &lt;code&gt;member&lt;/code&gt; element element as two mandatory child nodes &lt;code&gt;type&lt;/code&gt; which is the type of the given member (&lt;code&gt;int&lt;/code&gt;, &lt;code&gt;double&lt;/code&gt;, etc.) and &lt;code&gt;name&lt;/code&gt; which is the member name. The member name has to start with a capital letter. There are ten optional child nodes: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;const&lt;/code&gt; which set on/off the constness of the member (default is &lt;code&gt;false&lt;/code&gt;), &lt;/li&gt;
&lt;li&gt;&lt;code&gt;ref&lt;/code&gt; which tells if the member is a value (&lt;code&gt;false&lt;/code&gt;, default) or a reference (&lt;code&gt;true&lt;/code&gt;), &lt;/li&gt;
&lt;li&gt;&lt;code&gt;ptr&lt;/code&gt; which tells whether the member is a pointer (&lt;code&gt;true&lt;/code&gt;) or not (default), &lt;/li&gt;
&lt;li&gt;&lt;code&gt;static&lt;/code&gt; which indicates if the member is static (&lt;code&gt;true&lt;/code&gt;) or not (&lt;code&gt;false&lt;/code&gt;, default), &lt;/li&gt;
&lt;li&gt;&lt;code&gt;value&lt;/code&gt; which sets the value of the member when it is static. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;There are switches allowing to generate automatic methods: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;stdGet&lt;/code&gt;, &lt;code&gt;stdSet&lt;/code&gt;, both having a default value set to &lt;code&gt;true&lt;/code&gt; control the production of standard get and set methods, &lt;/li&gt;
&lt;li&gt;&lt;code&gt;ptrGet&lt;/code&gt; and &lt;code&gt;ptrSet&lt;/code&gt; control the production of pointer get and set methods (see &lt;a class="" href="../AutomatedBehaviour#Automatic_methods"&gt;Automatic methods&lt;/a&gt;). &lt;/li&gt;
&lt;li&gt;&lt;code&gt;refGet&lt;/code&gt; controls the addition of the getter by reference, which allows to modify the instance. &lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;protected&lt;/code&gt; and &lt;code&gt;private&lt;/code&gt; elements are optional and can contain again any number of &lt;code&gt;constructor&lt;/code&gt;, &lt;code&gt;method&lt;/code&gt;, and &lt;code&gt;member&lt;/code&gt; elements. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In order to create a structure instead of a class, the &lt;code&gt;class&lt;/code&gt; element node name has to be replaced by &lt;code&gt;struct&lt;/code&gt;. The contents of such an element node is identical to the one describing a class. &lt;/p&gt;
&lt;p&gt;For most of the optional child nodes containing a boolean value, the element node can be let empty, in which case the value is assumed to be opposite to the default value, e.g. &lt;code&gt;&amp;lt;const&amp;gt; true &amp;lt;/const&amp;gt;&lt;/code&gt; for an argument can be replaced by &lt;code&gt;&amp;lt;const/&amp;gt;&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;&lt;a class="" href="/p/generatecppfomxml/wiki/XmlFileContent"&gt;Back on top&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="concerning-templates"&gt;Concerning templates&lt;/h1&gt;
&lt;p&gt;If the described object is a template, then the contents of the &lt;code&gt;template&amp;lt; ... &amp;gt;&lt;/code&gt; coming before the object declaration must be determined. For each element present in the &lt;code&gt;template&amp;lt; ... &amp;gt;&lt;/code&gt; line, a &lt;code&gt;template&lt;/code&gt; element node must be added to the object description, between &lt;code&gt;comments&lt;/code&gt; and &lt;code&gt;inherits&lt;/code&gt;. The &lt;code&gt;template&lt;/code&gt; element contains a two child nodes, which are &lt;code&gt;identifier&lt;/code&gt; (the alias used for the type), and a &lt;code&gt;keyword&lt;/code&gt; setting the used keyword. For instance, to get &lt;code&gt;template&amp;lt; typename T&amp;gt;&lt;/code&gt;, the following line must be written: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt; &lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;identifier&amp;gt;&lt;/span&gt; T &lt;span class="nt"&gt;&amp;lt;/identifier&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;keyword&amp;gt;&lt;/span&gt; typename &lt;span class="nt"&gt;&amp;lt;/keyword&amp;gt;&lt;/span&gt; 
 &lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;whilst getting &lt;code&gt;template&amp;lt; class MyClass &amp;gt;&lt;/code&gt; requires &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt; &lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;identifier&amp;gt;&lt;/span&gt; MyClass &lt;span class="nt"&gt;&amp;lt;/identifier&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;keyword&amp;gt;&lt;/span&gt; class &lt;span class="nt"&gt;&amp;lt;/keyword&amp;gt;&lt;/span&gt; 
 &lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In the same way, a method (or constructor) of an object can be a template. In this case the &lt;code&gt;method&lt;/code&gt; (or &lt;code&gt;constructor&lt;/code&gt;) element first child is a &lt;code&gt;template&lt;/code&gt; element, using the same syntax as here above. &lt;/p&gt;
&lt;p&gt;&lt;a class="" href="/p/generatecppfomxml/wiki/XmlFileContent"&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:20 -0000</pubDate><guid>https://sourceforge.net157a13e8a06cc3e4fd82a0ebbcbce2aa2d891d12</guid></item></channel></rss>