<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to XmlFileContent1dot1AndBefore</title><link>https://sourceforge.net/p/xml-cpp-class-generator/wiki/XmlFileContent1dot1AndBefore/</link><description>Recent changes to XmlFileContent1dot1AndBefore</description><atom:link href="https://sourceforge.net/p/xml-cpp-class-generator/wiki/XmlFileContent1dot1AndBefore/feed" rel="self"/><language>en</language><lastBuildDate>Sat, 23 Apr 2016 11:46:19 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/xml-cpp-class-generator/wiki/XmlFileContent1dot1AndBefore/feed" rel="self" type="application/rss+xml"/><item><title>XmlFileContent1dot1AndBefore modified by Johan Luisier</title><link>https://sourceforge.net/p/xml-cpp-class-generator/wiki/XmlFileContent1dot1AndBefore/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -20,14 +20,14 @@
 # XML header and root element

 Any XML class description file you define should look like the following example: 
-    
-     
+```xml
+

-&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;
+&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;

-&amp;lt;classes&amp;gt;
-
+&amp;lt;classes&amp;gt;
+```
 Note that the encoding is UTF-8, this cannot be changed _unless_ 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). 

 In the `classes` root element can be as many `class` or `struct` element nodes as wanted. 
@@ -37,7 +37,7 @@
 # The `class` element node

 An example of class is given here below: 
-    
+```xml
      &amp;lt;class&amp;gt; 
        &amp;lt;name&amp;gt; ExampleClass &amp;lt;/name&amp;gt; 
        &amp;lt;author&amp;gt; George C. Clark &amp;lt;/author&amp;gt; 
@@ -71,7 +71,7 @@
        &amp;lt;/protected&amp;gt; 
        &amp;lt;private/&amp;gt; 
      &amp;lt;/class&amp;gt;
-
+```
 The presented example illustrates many features of the structure. 

   * The class `name`, `author` are mandatory (and self-explanatory). 
@@ -86,53 +86,32 @@
   * An `argument` element as one mandatory attribute `type` which is the type of the given argument (`int`, `double`, etc.) and four optional ones: `const` which set on/off the constness of the argument (default is `false`), `ref` which tells if the argument is passed by value (`false`, default) or by reference (`true`), `ptr` which tells whether the argument is a pointer (`true`) or not (default), and `default` which can be used to set a default value for the argument. The value of the element is the argument name. 
   * The optional element `copyConstructor` contains only one data value which can be either `true` or `false` (default). When set to `true` a copy constructor will be automatically added to the list of constructors, and its body will be written as well. There can be _at most_ one `copyConstructor `element. If by chance it is present in several places (e.g. in `public` and in `private`), only the first occurrence will be taken into account. 
   * The optional element `affectationOperator` contains only one boolean data field too, with default value set to `false`. When set to `true` it triggers the addition of the affectation operator: 
-    
+```cpp
      MyClass&amp;amp; operator=( const MyClass &amp;amp; myClass );
-
+```
 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 `public` and in `private`), only the first occurrence will be taken into account. 

   * The optional element `comparisonOperator` contains as well only one boolean data field, with default value `false`. It triggers the addition of a comparison method: 
-    
+```cpp
      bool operator==( const MyClass &amp;amp; myClass ) const;
-
+```
 Again the method body is generated automatically. If by chance it is present in several places (e.g. in `public` and in `private`), only the first occurrence will be taken into account. 

   * A `method` has mandatory `return` and `name` elements, defining 

-&amp;gt; the return type and the method name. It can have as many `argument` elements as desired, and has an optional `const` element, which sets the `const` switch of the method (a `const` method cannot modify the calling instance members), which default value is `false`. Other boolean optional elements are `static`, `virtual` and `pureVirtual`, all of them having `false` as default value, and indicate if the method is static, virtual or pure virtual. 
+    + the return type and the method name. It can have as many `argument` elements as desired, and has an optional `const` element, which sets the `const` switch of the method (a `const` method cannot modify the calling instance members), which default value is `false`. Other boolean optional elements are `static`, `virtual` and `pureVirtual`, all of them having `false` as default value, and indicate if the method is static, virtual or pure virtual. 

-  * The `return` element has as one mandatory attribute `type` which is the type of the returned variable (`int`, `void`, etc.) and four optional ones: `const` which set on/off the constness of the returned value (default is `false`), `ref` which tells if the returned value is passed by value (`false`, default) or by reference (`true`), and `ptr` which tells whether the returned value is a pointer (`true`) or not (default). 
-  * A `member` element element as one mandatory attribute `type`
-
-&amp;gt; which is the type of the given member (`int`, `double`, etc.) and nine optional ones: 
-&amp;gt; 
-&amp;gt;   * `const` which set on/off the constness of the member (default 
-&amp;gt;
-&amp;gt;&amp;gt; is `false`), 
-&amp;gt; 
-&amp;gt;   * `ref` which tells if the member is a value (`false`, default) 
-&amp;gt;
-&amp;gt;&amp;gt; or a reference (`true`), 
-&amp;gt; 
-&amp;gt;   * `ptr` which tells whether the member is a pointer (`true`) or 
-&amp;gt;
-&amp;gt;&amp;gt; not (default), 
-&amp;gt; 
-&amp;gt;   * `static` which indicates if the member is static (`true`) or not 
-&amp;gt;
-&amp;gt;&amp;gt; (`false`, default), 
-&amp;gt; 
-&amp;gt;   * `value` which sets the value of the member when it is static. 
-&amp;gt; There are switches allowing to generate automatic methods: 
-&amp;gt;   * `stdGet`, `stdSet`, both having a default value set to `true`
-&amp;gt;
-&amp;gt;&amp;gt; control the production of standard get and set methods, 
-&amp;gt; 
-&amp;gt;   * `ptrGet` and `ptrSet` control the production of pointer get and 
-&amp;gt;
-&amp;gt;&amp;gt; set methods (see [AutomatedBehaviour#Automatic_methods Automatic methods]). 
-&amp;gt; 
-&amp;gt; The value of the element is the member name. 
+    + The `return` element has as one mandatory attribute `type` which is the type of the returned variable (`int`, `void`, etc.) and four optional ones: `const` which set on/off the constness of the returned value (default is `false`), `ref` which tells if the returned value is passed by value (`false`, default) or by reference (`true`), and `ptr` which tells whether the returned value is a pointer (`true`) or not (default). 
+    + A `member` element element as one mandatory attribute `type` which is the type of the given member (`int`, `double`, etc.) and nine optional ones: 
+      - `const` which set on/off the constness of the member (default is `false`), 
+      - `ref` which tells if the member is a value (`false`, default)  or a reference (`true`), 
+      - `ptr` which tells whether the member is a pointer (`true`) or  not (default), 
+      - `static` which indicates if the member is static (`true`) or not  (`false`, default), 
+      - `value` which sets the value of the member when it is static. 
+There are switches allowing to generate automatic methods: 
+  * `stdGet`, `stdSet`, both having a default value set to `true` control the production of standard get and set methods, 
+  * `ptrGet` and `ptrSet` control the production of pointer get and set methods (see [AutomatedBehaviour#Automatic_methods Automatic methods]). 
+ The value of the element is the member name. 

   * The `protected` and `private` elements are optional and can contain again any number of `constructor`, `method`, and `member` elements. 

@@ -140,7 +119,7 @@

   * A structure does not require a public constructor to be defined, the only requirement is that one public constructor / method / member is defined. 
   * A virtual destructor is by default not added to the structure. The addition is controlled by a specific element node: `destructor`, which goes just _before_ the `public` element node, and contains a boolean value. If this element node is not present, it is assumed that no destructor is wanted. Here below is given an example: 
-    
+```xml
      &amp;lt;struct&amp;gt; 
         
        &amp;lt;implementationUsedNamespace&amp;gt; std &amp;lt;/implementationUsedNamespace&amp;gt; 
@@ -150,20 +129,20 @@
        &amp;lt;/public&amp;gt; 
        
      &amp;lt;/struct&amp;gt; 
-
+```
 [Back on top](XmlFileContent)

 # Concerning templates

-If the described object is a template, then the contents of the `template&amp;lt; ... &amp;gt;` coming before the object declaration must be determined. For each element present in the `template&amp;lt; ... &amp;gt;` line, a `template` element node must be added to the object description, between `comments` and `inherits`. The `template` element contains a value which is the alias used for the type, and a `keyword` attribute setting the used keyword. For instance, to get {{{template&amp;lt; typename T&amp;gt;}}}, the following line must be written 
-    
+If the described object is a template, then the contents of the `template&amp;lt; ... &amp;gt;` coming before the object declaration must be determined. For each element present in the `template&amp;lt; ... &amp;gt;` line, a `template` element node must be added to the object description, between `comments` and `inherits`. The `template` element contains a value which is the alias used for the type, and a `keyword` attribute setting the used keyword. For instance, to get `template&amp;lt; typename T &amp;gt;`, the following line must be written 
+```xml
      &amp;lt;template keyword="typename"&amp;gt; T
      &amp;lt;/template&amp;gt;
-
+```
 whilst getting `template&amp;lt; class MyClass &amp;gt;` requires 
-    
+```xml
      &amp;lt;template keyword="class"&amp;gt; MyClass &amp;lt;/template&amp;gt;
-
+```
 In the same way, a method (or constructor) of an object can be a template. In this case the `method` (or `constructor`) element first child is a `template` element, using the same syntax as here above. 

 [Back on top](XmlFileContent)
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Johan Luisier</dc:creator><pubDate>Sat, 23 Apr 2016 11:46:19 -0000</pubDate><guid>https://sourceforge.net78f14319de60ac612fc50fcdf257aa965d3c8103</guid></item><item><title>XmlFileContent1dot1AndBefore modified by Anonymous</title><link>https://sourceforge.net/p/generatecppfomxml/wiki/XmlFileContent1dot1AndBefore/</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;p&gt;This information concerns XmlCppClassGenerator versions &lt;strong&gt;1.1 and before&lt;/strong&gt;, please refer to &lt;a class="" href="/p/generatecppfomxml/wiki/XmlFileContent"&gt;XmlFileContent&lt;/a&gt; for documentation on the current version. &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&lt;/span&gt; &lt;span class="na"&gt;access=&lt;/span&gt;&lt;span class="s"&gt;"public"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; std::string &lt;span class="nt"&gt;&amp;lt;/inherits&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;inherits&lt;/span&gt; &lt;span class="na"&gt;access=&lt;/span&gt;&lt;span class="s"&gt;"protected"&lt;/span&gt; &lt;span class="na"&gt;virtual=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="nt"&gt;&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;/inherits&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;headerInclude&amp;gt;&lt;/span&gt; string &lt;span class="nt"&gt;&amp;lt;/headerInclude&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;headerInclude&amp;gt;&lt;/span&gt; vector &lt;span class="nt"&gt;&amp;lt;/headerInclude&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;implementationInclude&amp;gt;&lt;/span&gt; iostream &lt;span class="nt"&gt;&amp;lt;/implementationInclude&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;headerUsedNamespace&amp;gt;&lt;/span&gt; std &lt;span class="nt"&gt;&amp;lt;/headerUsedNamespace&amp;gt;&lt;/span&gt; 
   &lt;span class="nt"&gt;&amp;lt;implementationUsedNamespace&amp;gt;&lt;/span&gt; std &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&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"unsigned"&lt;/span&gt; &lt;span class="na"&gt;const=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;ref=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;default=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; nbr &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; true &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; true &lt;span class="nt"&gt;&amp;lt;/comparisonOperator&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&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"bool"&lt;/span&gt;&lt;span class="nt"&gt;/&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&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"unsigned"&lt;/span&gt; &lt;span class="na"&gt;const=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;ptr=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;ref=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; testNbr &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&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"std::string"&lt;/span&gt; &lt;span class="na"&gt;static=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"&amp;amp;quot;Hello World!&amp;amp;quot;"&lt;/span&gt; &lt;span class="na"&gt;stdGet=&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt; &lt;span class="na"&gt;stdSet=&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; 
        StupidMessage 
       &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="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"int"&lt;/span&gt; &lt;span class="na"&gt;stdGet=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;stdSet=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;ptrGet=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;ptrSet=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; AnotherCounter &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;/li&gt;
&lt;li&gt;&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;. &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 &lt;code&gt;inherits&lt;/code&gt; element has two optional attributes: &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! &lt;/li&gt;
&lt;li&gt;The optional &lt;code&gt;headerInclude&lt;/code&gt; element(s) defines which &lt;code&gt;#include&lt;/code&gt; should be added in the header file, these elements have an optional attribute &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). The &lt;code&gt;implementationHeader&lt;/code&gt; optional element has the same behaviour (and the same optional attribute) for the class implementation file. &lt;/li&gt;
&lt;li&gt;The optional &lt;code&gt;headerUsedNamespace&lt;/code&gt; and &lt;code&gt;implementationUsedNamespace&lt;/code&gt; define the &lt;code&gt;using namespace&lt;/code&gt; statements used either in the header or in 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 &lt;code&gt;constructor&lt;/code&gt; element. It can contain as many &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 one mandatory attribute &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 four optional ones: &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. The value of the element is the argument name. &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;method&lt;/code&gt; has mandatory &lt;code&gt;return&lt;/code&gt; and &lt;code&gt;name&lt;/code&gt; elements, defining &lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;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;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;return&lt;/code&gt; element has as one mandatory attribute &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;/li&gt;
&lt;li&gt;A &lt;code&gt;member&lt;/code&gt; element element as one mandatory attribute &lt;code&gt;type&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&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 nine optional ones: &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 &lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;is &lt;code&gt;false&lt;/code&gt;), &lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&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) &lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;or a reference (&lt;code&gt;true&lt;/code&gt;), &lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&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 &lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;not (default), &lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&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;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;(&lt;code&gt;false&lt;/code&gt;, default), &lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;value&lt;/code&gt; which sets the value of the member when it is static. &lt;br /&gt;
There are switches allowing to generate automatic methods: &lt;/li&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;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;control the production of standard get and set methods, &lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&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 &lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;set methods (see &lt;span&gt;[AutomatedBehaviour#Automatic_methods Automatic methods]&lt;/span&gt;). &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The value of the element is the member name. &lt;/p&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 &lt;em&gt;almost&lt;/em&gt; identical to the one describing a class. The two differences are : &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A structure does not require a public constructor to be defined, the only requirement is that one public constructor / method / member is defined. &lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A virtual destructor is by default not added to the structure. The addition is controlled by a specific element node: &lt;code&gt;destructor&lt;/code&gt;, which goes just &lt;em&gt;before&lt;/em&gt; the &lt;code&gt;public&lt;/code&gt; element node, and contains a boolean value. If this element node is not present, it is assumed that no destructor is wanted. Here below is given an example: &lt;/p&gt;
&lt;p&gt;&amp;lt;struct&amp;gt; &lt;br /&gt;
&lt;br /&gt;
   &amp;lt;implementationUsedNamespace&amp;gt; std &amp;lt;/implementationUsedNamespace&amp;gt; &lt;br /&gt;
   &amp;lt;destructor&amp;gt; true &amp;lt;/destructor&amp;gt; &lt;br /&gt;
   &amp;lt;public&amp;gt; &lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/public&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/struct&amp;gt; &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&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 value which is the alias used for the type, and a &lt;code&gt;keyword&lt;/code&gt; attribute setting the used keyword. For instance, to get {{{template&amp;lt; typename T&amp;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&lt;/span&gt; &lt;span class="na"&gt;keyword=&lt;/span&gt;&lt;span class="s"&gt;"typename"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; T
 &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&lt;/span&gt; &lt;span class="na"&gt;keyword=&lt;/span&gt;&lt;span class="s"&gt;"class"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; MyClass &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:22 -0000</pubDate><guid>https://sourceforge.net70c5b545bcac22676aff1ed6ce7bcd3140e64465</guid></item></channel></rss>