diff options
Diffstat (limited to 'zenxml/doc/bind_8h_source.html')
-rw-r--r-- | zenxml/doc/bind_8h_source.html | 498 |
1 files changed, 257 insertions, 241 deletions
diff --git a/zenxml/doc/bind_8h_source.html b/zenxml/doc/bind_8h_source.html index 300a10aa..e8e9e831 100644 --- a/zenxml/doc/bind_8h_source.html +++ b/zenxml/doc/bind_8h_source.html @@ -3,46 +3,36 @@ <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> +<meta name="generator" content="Doxygen 1.8.6"/> <title>zen::Xml: bind.h Source File</title> - <link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css" /> - -<link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> +<script type="text/javascript" src="dynsections.js"></script> +<link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> - +<link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> -<div id="top"><!-- do not remove this div! --> - - +<div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> - <td id="projectlogo"><img alt="Logo" src="zenXml.png"/></td> - - <td style="padding-left: 0.5em;"> <div id="projectname">zen::Xml - </div> <div id="projectbrief">Simple C++ XML Processing</div> </td> - - - </tr> </tbody> </table> </div> - -<!-- Generated by Doxygen 1.8.0 --> +<!-- end header part --> +<!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> @@ -51,7 +41,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> - <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> @@ -70,18 +59,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); </li> </ul> </div> - <div id="navrow2" class="tabs2"> - <ul class="tablist"> - <li><a href="files.html"><span>File List</span></a></li> - </ul> - </div> -</div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> -<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a></div> +<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> @@ -90,230 +73,263 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); </iframe> </div> +<div id="nav-path" class="navpath"> + <ul> +<li class="navelem"><a class="el" href="dir_5fe60cdff4f93e8435d81ae38a3e2e18.html">zenxml</a></li> </ul> +</div> +</div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">bind.h</div> </div> </div><!--header--> <div class="contents"> -<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// **************************************************************************</span> -<a name="l00002"></a>00002 <span class="comment">// * This file is part of the zen::Xml project. It is distributed under the *</span> -<a name="l00003"></a>00003 <span class="comment">// * Boost Software License: http://www.boost.org/LICENSE_1_0.txt *</span> -<a name="l00004"></a>00004 <span class="comment">// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *</span> -<a name="l00005"></a>00005 <span class="comment">// **************************************************************************</span> -<a name="l00006"></a>00006 -<a name="l00007"></a>00007 <span class="preprocessor">#ifndef ZEN_XML_BIND_HEADER_9081740816593478258435</span> -<a name="l00008"></a>00008 <span class="preprocessor"></span><span class="preprocessor">#define ZEN_XML_BIND_HEADER_9081740816593478258435</span> -<a name="l00009"></a>00009 <span class="preprocessor"></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <set></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "cvrt_struc.h"</span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "parser.h"</span> -<a name="l00013"></a>00013 <span class="preprocessor">#include "io.h"</span> -<a name="l00014"></a>00014 -<a name="l00015"></a><a class="code" href="namespacezen.html">00015</a> <span class="keyword">namespace </span>zen -<a name="l00016"></a>00016 { -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 -<a name="l00032"></a>00032 <span class="keyword">template</span> <<span class="keyword">class</span> String> <span class="keyword">inline</span> -<a name="l00033"></a><a class="code" href="namespacezen.html#a900c1fb290f0eedc24354c487145dbee">00033</a> <span class="keywordtype">void</span> <a class="code" href="namespacezen.html#a900c1fb290f0eedc24354c487145dbee" title="Load XML document from a file.">load</a>(<span class="keyword">const</span> String& filename, <a class="code" href="classzen_1_1_xml_doc.html" title="The complete XML document.">XmlDoc</a>& doc) <span class="comment">//throw XmlFileError, XmlParsingError</span> -<a name="l00034"></a>00034 { -<a name="l00035"></a>00035 std::string stream = <a class="code" href="namespacezen.html#a04fe23c3bd9b7d03309620b5ea763607" title="Load byte stream from a file.">loadStream</a>(filename); <span class="comment">//throw XmlFileError</span> -<a name="l00036"></a>00036 <a class="code" href="namespacezen.html#a6cf1ec0b57fc1ae9aa95761800e67ec7" title="Load XML document from a byte stream.">parse</a>(stream, doc); <span class="comment">//throw XmlParsingError</span> -<a name="l00037"></a>00037 } -<a name="l00038"></a>00038 -<a name="l00039"></a>00039 -<a name="l00041"></a>00041 -<a name="l00051"></a>00051 <span class="keyword">template</span> <<span class="keyword">class</span> String> <span class="keyword">inline</span> -<a name="l00052"></a><a class="code" href="namespacezen.html#adeeb6b2318097382ae47aa939fc15d4d">00052</a> <span class="keywordtype">void</span> <a class="code" href="namespacezen.html#adeeb6b2318097382ae47aa939fc15d4d" title="Save XML document to a file.">save</a>(<span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_doc.html" title="The complete XML document.">XmlDoc</a>& doc, -<a name="l00053"></a>00053 <span class="keyword">const</span> String& filename, -<a name="l00054"></a>00054 <span class="keyword">const</span> std::string& lineBreak = <span class="stringliteral">"\r\n"</span>, -<a name="l00055"></a>00055 <span class="keyword">const</span> std::string& indent = <span class="stringliteral">" "</span>) <span class="comment">//throw XmlFileError</span> -<a name="l00056"></a>00056 { -<a name="l00057"></a>00057 std::string stream = <a class="code" href="namespacezen.html#afaa4920e275078e6c8009fbdf58b57ee" title="Save XML document as a byte stream.">serialize</a>(doc, lineBreak, indent); <span class="comment">//throw ()</span> -<a name="l00058"></a>00058 <a class="code" href="namespacezen.html#a4ba7bbaa14a787b07fc13da9145aabe2" title="Save byte stream to a file.">saveStream</a>(stream, filename); <span class="comment">//throw XmlFileError</span> -<a name="l00059"></a>00059 } -<a name="l00060"></a>00060 -<a name="l00061"></a>00061 -<a name="l00063"></a><a class="code" href="classzen_1_1_xml_out.html">00063</a> <span class="keyword">class </span><a class="code" href="classzen_1_1_xml_out.html" title="Proxy class to conveniently convert user data into XML structure.">XmlOut</a> -<a name="l00064"></a>00064 { -<a name="l00065"></a>00065 <span class="keyword">public</span>: -<a name="l00067"></a>00067 -<a name="l00088"></a><a class="code" href="classzen_1_1_xml_out.html#ad8b1ccb8f3d4e7b0ab2598597ea50bcc">00088</a> <a class="code" href="classzen_1_1_xml_out.html#ad8b1ccb8f3d4e7b0ab2598597ea50bcc" title="Construct an output proxy for an XML document.">XmlOut</a>(<a class="code" href="classzen_1_1_xml_doc.html" title="The complete XML document.">XmlDoc</a>& doc) : ref_(&doc.root()) {} -<a name="l00090"></a>00090 -<a name="l00093"></a><a class="code" href="classzen_1_1_xml_out.html#aa80be3a56f70a58d2730a763166088c0">00093</a> <a class="code" href="classzen_1_1_xml_out.html#aa80be3a56f70a58d2730a763166088c0" title="Construct an output proxy for a single XML element.">XmlOut</a>(<a class="code" href="classzen_1_1_xml_element.html" title="An XML element.">XmlElement</a>& element) : ref_(&element) {} -<a name="l00094"></a>00094 -<a name="l00096"></a>00096 -<a name="l00101"></a>00101 <span class="keyword">template</span> <<span class="keyword">class</span> String> -<a name="l00102"></a><a class="code" href="classzen_1_1_xml_out.html#a00f883d3f9d60535b06b5ae609dc8831">00102</a> <a class="code" href="classzen_1_1_xml_out.html" title="Proxy class to conveniently convert user data into XML structure.">XmlOut</a> <a class="code" href="classzen_1_1_xml_out.html#a00f883d3f9d60535b06b5ae609dc8831" title="Retrieve a handle to an XML child element for writing.">operator[]</a>(<span class="keyword">const</span> String& name)<span class="keyword"> const</span> -<a name="l00103"></a>00103 <span class="keyword"> </span>{ -<a name="l00104"></a>00104 <span class="keyword">const</span> std::string utf8name = utfCvrtTo<std::string>(name); -<a name="l00105"></a>00105 <a class="code" href="classzen_1_1_xml_element.html" title="An XML element.">XmlElement</a>* child = ref_-><a class="code" href="classzen_1_1_xml_element.html#a3ab82b1720460487f4afabcd115d0c7e" title="Retrieve a child element with the given name.">getChild</a>(utf8name); -<a name="l00106"></a>00106 <span class="keywordflow">return</span> child ? *child : ref_-><a class="code" href="classzen_1_1_xml_element.html#a653caffa6fad89db7d14f67f987ad0f9" title="Create a new child element and return a reference to it.">addChild</a>(utf8name); -<a name="l00107"></a>00107 } -<a name="l00108"></a>00108 -<a name="l00110"></a>00110 -<a name="l00114"></a>00114 <span class="keyword">template</span> <<span class="keyword">class</span> T> -<a name="l00115"></a><a class="code" href="classzen_1_1_xml_out.html#a09ca9144515e3c109b36062b0475c8eb">00115</a> <span class="keywordtype">void</span> <a class="code" href="classzen_1_1_xml_out.html#a09ca9144515e3c109b36062b0475c8eb" title="Write user data to the underlying XML element.">operator()</a>(<span class="keyword">const</span> T& value) { <a class="code" href="namespacezen.html#a29ddb823fe0a195f19a64448881b8bf6" title="Convert structured user data into an XML element.">writeStruc</a>(value, *ref_); } -<a name="l00116"></a>00116 -<a name="l00118"></a>00118 -<a name="l00142"></a>00142 <span class="keyword">template</span> <<span class="keyword">class</span> String, <span class="keyword">class</span> T> -<a name="l00143"></a><a class="code" href="classzen_1_1_xml_out.html#acaf9b71fe1d907dd63dd4b91e2e03805">00143</a> <span class="keywordtype">void</span> <a class="code" href="classzen_1_1_xml_out.html#acaf9b71fe1d907dd63dd4b91e2e03805" title="Write user data to an XML attribute.">attribute</a>(<span class="keyword">const</span> String& name, <span class="keyword">const</span> T& value) { ref_-><a class="code" href="classzen_1_1_xml_element.html#a211a6f037c22a54d3facb7a8347a8421" title="Create or update an XML attribute.">setAttribute</a>(name, value); } -<a name="l00144"></a>00144 -<a name="l00146"></a><a class="code" href="classzen_1_1_xml_out.html#aec117344e8a534382e8d5e76711f97b2">00146</a> <a class="code" href="classzen_1_1_xml_element.html" title="An XML element.">XmlElement</a>& <a class="code" href="classzen_1_1_xml_out.html#aec117344e8a534382e8d5e76711f97b2" title="Return a reference to the underlying Xml element.">ref</a>() { <span class="keywordflow">return</span> *ref_; } -<a name="l00147"></a>00147 -<a name="l00148"></a>00148 <span class="keyword">private</span>: -<a name="l00149"></a>00149 <a class="code" href="classzen_1_1_xml_element.html" title="An XML element.">XmlElement</a>* ref_; <span class="comment">//always bound!</span> -<a name="l00150"></a>00150 }; -<a name="l00151"></a>00151 -<a name="l00152"></a>00152 -<a name="l00154"></a><a class="code" href="classzen_1_1_xml_in.html">00154</a> <span class="keyword">class </span><a class="code" href="classzen_1_1_xml_in.html" title="Proxy class to conveniently convert XML structure to user data.">XmlIn</a> -<a name="l00155"></a>00155 { -<a name="l00156"></a>00156 <span class="keyword">class </span>ErrorLog; -<a name="l00157"></a>00157 <span class="keyword">struct </span>ConversionToBool { <span class="keywordtype">int</span> dummy; }; -<a name="l00158"></a>00158 -<a name="l00159"></a>00159 <span class="keyword">public</span>: -<a name="l00161"></a>00161 -<a name="l00171"></a><a class="code" href="classzen_1_1_xml_in.html#a5b48c9848e6c631a04cec2477ff85c0f">00171</a> <a class="code" href="classzen_1_1_xml_in.html#a5b48c9848e6c631a04cec2477ff85c0f" title="Construct an input proxy for an XML document.">XmlIn</a>(<span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_doc.html" title="The complete XML document.">XmlDoc</a>& doc) : refIndex(0), log(std::make_shared<ErrorLog>()) { refList.push_back(&doc.<a class="code" href="classzen_1_1_xml_doc.html#ad4a9594d93885fc1a12db28e8246648d" title="Get a const reference to the document's root element.">root</a>()); } -<a name="l00173"></a>00173 -<a name="l00176"></a><a class="code" href="classzen_1_1_xml_in.html#ae072660cde71fd4695c04d074098b430">00176</a> <a class="code" href="classzen_1_1_xml_in.html#ae072660cde71fd4695c04d074098b430" title="Construct an input proxy for a single XML element, may be nullptr.">XmlIn</a>(<span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_element.html" title="An XML element.">XmlElement</a>* element) : refIndex(0), log(std::make_shared<ErrorLog>()) { refList.push_back(element); } -<a name="l00178"></a>00178 -<a name="l00181"></a><a class="code" href="classzen_1_1_xml_in.html#a33de75412df69cb25e0fd8b3bc70c9f8">00181</a> <a class="code" href="classzen_1_1_xml_in.html#a33de75412df69cb25e0fd8b3bc70c9f8" title="Construct an input proxy for a single XML element.">XmlIn</a>(<span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_element.html" title="An XML element.">XmlElement</a>& element) : refIndex(0), log(std::make_shared<ErrorLog>()) { refList.push_back(&element); } -<a name="l00182"></a>00182 -<a name="l00184"></a>00184 -<a name="l00189"></a>00189 <span class="keyword">template</span> <<span class="keyword">class</span> String> -<a name="l00190"></a><a class="code" href="classzen_1_1_xml_in.html#a9b38167835a28eac9a2297f35f51e53d">00190</a> <a class="code" href="classzen_1_1_xml_in.html" title="Proxy class to conveniently convert XML structure to user data.">XmlIn</a> <a class="code" href="classzen_1_1_xml_in.html#a9b38167835a28eac9a2297f35f51e53d" title="Retrieve a handle to an XML child element for reading.">operator[]</a>(<span class="keyword">const</span> String& name)<span class="keyword"> const</span> -<a name="l00191"></a>00191 <span class="keyword"> </span>{ -<a name="l00192"></a>00192 std::vector<const XmlElement*> childList; -<a name="l00193"></a>00193 -<a name="l00194"></a>00194 <span class="keywordflow">if</span> (refIndex < refList.size()) -<a name="l00195"></a>00195 { -<a name="l00196"></a>00196 <span class="keyword">auto</span> iterPair = refList[refIndex]->getChildren(name); -<a name="l00197"></a>00197 std::for_each(iterPair.first, iterPair.second, -<a name="l00198"></a>00198 [&](<span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_element.html" title="An XML element.">XmlElement</a>& child) { childList.push_back(&child); }); -<a name="l00199"></a>00199 } -<a name="l00200"></a>00200 -<a name="l00201"></a>00201 <span class="keywordflow">return</span> <a class="code" href="classzen_1_1_xml_in.html#a5b48c9848e6c631a04cec2477ff85c0f" title="Construct an input proxy for an XML document.">XmlIn</a>(childList, childList.empty() ? getChildNameFormatted(name) : std::string(), log); -<a name="l00202"></a>00202 } -<a name="l00203"></a>00203 -<a name="l00205"></a>00205 -<a name="l00225"></a><a class="code" href="classzen_1_1_xml_in.html#a60cf2678c989621545d27745dcafa4a4">00225</a> <span class="keywordtype">void</span> <a class="code" href="classzen_1_1_xml_in.html#a60cf2678c989621545d27745dcafa4a4" title="Refer to next sibling element with the same name.">next</a>() { ++refIndex; } -<a name="l00226"></a>00226 -<a name="l00228"></a>00228 -<a name="l00233"></a>00233 <span class="keyword">template</span> <<span class="keyword">class</span> T> -<a name="l00234"></a><a class="code" href="classzen_1_1_xml_in.html#a98cc59f687c89549381e76105f8fb506">00234</a> <span class="keywordtype">bool</span> operator()(T& value)<span class="keyword"> const</span> -<a name="l00235"></a>00235 <span class="keyword"> </span>{ -<a name="l00236"></a>00236 <span class="keywordflow">if</span> (refIndex < refList.size()) -<a name="l00237"></a>00237 { -<a name="l00238"></a>00238 <span class="keywordtype">bool</span> success = <a class="code" href="namespacezen.html#a2bdcecfe7435ef11cedbce47d4e72ee1" title="Convert XML element to structured user data.">readStruc</a>(*refList[refIndex], value); -<a name="l00239"></a>00239 <span class="keywordflow">if</span> (!success) -<a name="l00240"></a>00240 log->notifyConversionError(getNameFormatted()); -<a name="l00241"></a>00241 <span class="keywordflow">return</span> success; -<a name="l00242"></a>00242 } -<a name="l00243"></a>00243 <span class="keywordflow">else</span> -<a name="l00244"></a>00244 { -<a name="l00245"></a>00245 log->notifyMissingElement(getNameFormatted()); -<a name="l00246"></a>00246 <span class="keywordflow">return</span> <span class="keyword">false</span>; -<a name="l00247"></a>00247 } -<a name="l00248"></a>00248 } -<a name="l00249"></a>00249 -<a name="l00251"></a>00251 -<a name="l00268"></a>00268 <span class="keyword">template</span> <<span class="keyword">class</span> String, <span class="keyword">class</span> T> -<a name="l00269"></a><a class="code" href="classzen_1_1_xml_in.html#a971cd7054c551c4460d5220f6ec5cf01">00269</a> <span class="keywordtype">bool</span> attribute(<span class="keyword">const</span> String& name, T& value)<span class="keyword"> const</span> -<a name="l00270"></a>00270 <span class="keyword"> </span>{ -<a name="l00271"></a>00271 <span class="keywordflow">if</span> (refIndex < refList.size()) -<a name="l00272"></a>00272 { -<a name="l00273"></a>00273 <span class="keywordtype">bool</span> success = refList[refIndex]->getAttribute(name, value); -<a name="l00274"></a>00274 <span class="keywordflow">if</span> (!success) -<a name="l00275"></a>00275 log->notifyMissingAttribute(getNameFormatted(), utfCvrtTo<std::string>(name)); -<a name="l00276"></a>00276 <span class="keywordflow">return</span> success; -<a name="l00277"></a>00277 } -<a name="l00278"></a>00278 <span class="keywordflow">else</span> -<a name="l00279"></a>00279 { -<a name="l00280"></a>00280 log->notifyMissingElement(getNameFormatted()); -<a name="l00281"></a>00281 <span class="keywordflow">return</span> <span class="keyword">false</span>; -<a name="l00282"></a>00282 } -<a name="l00283"></a>00283 } -<a name="l00284"></a>00284 -<a name="l00286"></a><a class="code" href="classzen_1_1_xml_in.html#a647b468b7c6c95b25f2e43627184177f">00286</a> <span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_element.html" title="An XML element.">XmlElement</a>* <span class="keyword">get</span>() <span class="keyword">const</span> { <span class="keywordflow">return</span> refIndex < refList.size() ? refList[refIndex] : <span class="keyword">nullptr</span>; } -<a name="l00287"></a>00287 -<a name="l00289"></a>00289 -<a name="l00298"></a><a class="code" href="classzen_1_1_xml_in.html#a954950849b52557369932ab2a8b4ad72">00298</a> operator int ConversionToBool::* ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">get</span>() ? &ConversionToBool::dummy : <span class="keyword">nullptr</span>; } -<a name="l00299"></a>00299 -<a name="l00301"></a>00301 -<a name="l00320"></a><a class="code" href="classzen_1_1_xml_in.html#a33b5dd504d3165aa3f923f6b33e9991a">00320</a> <span class="keywordtype">bool</span> <a class="code" href="classzen_1_1_xml_in.html#a33b5dd504d3165aa3f923f6b33e9991a" title="Notifies errors while mapping the XML to user data.">errorsOccured</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !log->elementList().empty(); } -<a name="l00321"></a>00321 -<a name="l00323"></a>00323 -<a name="l00327"></a>00327 <span class="keyword">template</span> <<span class="keyword">class</span> String> -<a name="l00328"></a><a class="code" href="classzen_1_1_xml_in.html#a84bb497d3b3fc753d054e52c4823c05e">00328</a> std::vector<String> getErrorsAs()<span class="keyword"> const</span> -<a name="l00329"></a>00329 <span class="keyword"> </span>{ -<a name="l00330"></a>00330 std::vector<String> output; -<a name="l00331"></a>00331 <span class="keyword">const</span> <span class="keyword">auto</span>& elements = log->elementList(); -<a name="l00332"></a>00332 std::transform(elements.begin(), elements.end(), std::back_inserter(output), [](<span class="keyword">const</span> std::string& str) { <span class="keywordflow">return</span> utfCvrtTo<String>(str); }); -<a name="l00333"></a>00333 <span class="keywordflow">return</span> output; -<a name="l00334"></a>00334 } -<a name="l00335"></a>00335 -<a name="l00336"></a>00336 <span class="keyword">private</span>: -<a name="l00337"></a>00337 <a class="code" href="classzen_1_1_xml_in.html" title="Proxy class to conveniently convert XML structure to user data.">XmlIn</a>(<span class="keyword">const</span> std::vector<const XmlElement*>& siblingList, <span class="keyword">const</span> std::string& elementNameFmt, <span class="keyword">const</span> std::shared_ptr<ErrorLog>& sharedlog) : -<a name="l00338"></a>00338 refList(siblingList), refIndex(0), formattedName(elementNameFmt), log(sharedlog) -<a name="l00339"></a>00339 { assert((!siblingList.empty() && elementNameFmt.empty()) || (siblingList.empty() && !elementNameFmt.empty())); } -<a name="l00340"></a>00340 -<a name="l00341"></a>00341 <span class="keyword">static</span> std::string getNameFormatted(<span class="keyword">const</span> XmlElement& elem) <span class="comment">//"<Root> <Level1> <Level2>"</span> -<a name="l00342"></a>00342 { -<a name="l00343"></a>00343 <span class="keywordflow">return</span> (elem.parent() ? getNameFormatted(*elem.parent()) + <span class="stringliteral">" "</span> : std::string()) + <span class="stringliteral">"<"</span> + elem.getNameAs<std::string>() + <span class="stringliteral">">"</span>; -<a name="l00344"></a>00344 } -<a name="l00345"></a>00345 -<a name="l00346"></a>00346 std::string getNameFormatted()<span class="keyword"> const</span> -<a name="l00347"></a>00347 <span class="keyword"> </span>{ -<a name="l00348"></a>00348 <span class="keywordflow">if</span> (refIndex < refList.size()) -<a name="l00349"></a>00349 { -<a name="l00350"></a>00350 assert(formattedName.empty()); -<a name="l00351"></a>00351 <span class="keywordflow">return</span> getNameFormatted(*refList[refIndex]); -<a name="l00352"></a>00352 } -<a name="l00353"></a>00353 <span class="keywordflow">else</span> -<a name="l00354"></a>00354 <span class="keywordflow">return</span> formattedName; -<a name="l00355"></a>00355 } -<a name="l00356"></a>00356 -<a name="l00357"></a>00357 std::string getChildNameFormatted(<span class="keyword">const</span> std::string& childName)<span class="keyword"> const</span> -<a name="l00358"></a>00358 <span class="keyword"> </span>{ -<a name="l00359"></a>00359 std::string parentName = getNameFormatted(); -<a name="l00360"></a>00360 <span class="keywordflow">return</span> (parentName.empty() ? std::string() : (parentName + <span class="stringliteral">" "</span>)) + <span class="stringliteral">"<"</span> + childName + <span class="stringliteral">">"</span>; -<a name="l00361"></a>00361 } -<a name="l00362"></a>00362 -<a name="l00363"></a>00363 <span class="keyword">class </span>ErrorLog -<a name="l00364"></a>00364 { -<a name="l00365"></a>00365 <span class="keyword">public</span>: -<a name="l00366"></a>00366 <span class="keywordtype">void</span> notifyConversionError (<span class="keyword">const</span> std::string& formattedName) { insert(formattedName); } -<a name="l00367"></a>00367 <span class="keywordtype">void</span> notifyMissingElement (<span class="keyword">const</span> std::string& formattedName) { insert(formattedName); } -<a name="l00368"></a>00368 <span class="keywordtype">void</span> notifyMissingAttribute(<span class="keyword">const</span> std::string& formattedName, <span class="keyword">const</span> std::string& attribName) { insert(formattedName + <span class="stringliteral">" @"</span> + attribName); } -<a name="l00369"></a>00369 -<a name="l00370"></a>00370 <span class="keyword">const</span> std::vector<std::string>& elementList()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> failedElements; } -<a name="l00371"></a>00371 -<a name="l00372"></a>00372 <span class="keyword">private</span>: -<a name="l00373"></a>00373 <span class="keywordtype">void</span> insert(<span class="keyword">const</span> std::string& newVal) -<a name="l00374"></a>00374 { -<a name="l00375"></a>00375 <span class="keywordflow">if</span> (usedElements.insert(newVal).second) -<a name="l00376"></a>00376 failedElements.push_back(newVal); -<a name="l00377"></a>00377 } -<a name="l00378"></a>00378 -<a name="l00379"></a>00379 std::vector<std::string> failedElements; <span class="comment">//unique list of failed elements</span> -<a name="l00380"></a>00380 std::set<std::string> usedElements; -<a name="l00381"></a>00381 }; -<a name="l00382"></a>00382 -<a name="l00383"></a>00383 std::vector<const XmlElement*> refList; <span class="comment">//all sibling elements with same name (all pointers bound!)</span> -<a name="l00384"></a>00384 <span class="keywordtype">size_t</span> refIndex; <span class="comment">//this sibling's index in refList</span> -<a name="l00385"></a>00385 std::string formattedName; <span class="comment">//contains full and formatted element name if (and only if) refList is empty</span> -<a name="l00386"></a>00386 std::shared_ptr<ErrorLog> log; <span class="comment">//always bound</span> -<a name="l00387"></a>00387 }; -<a name="l00388"></a>00388 } -<a name="l00389"></a>00389 -<a name="l00390"></a>00390 <span class="preprocessor">#endif //ZEN_XML_BIND_HEADER_9081740816593478258435</span> -</pre></div></div><!-- contents --> - - +<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// **************************************************************************</span></div> +<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// * This file is part of the FreeFileSync project. It is distributed under *</span></div> +<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *</span></div> +<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *</span></div> +<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// **************************************************************************</span></div> +<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> </div> +<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#ifndef ZEN_XML_BIND_HEADER_9081740816593478258435</span></div> +<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor"></span><span class="preprocessor">#define ZEN_XML_BIND_HEADER_9081740816593478258435</span></div> +<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor"></span></div> +<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include <set></span></div> +<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include "cvrt_struc.h"</span></div> +<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include "parser.h"</span></div> +<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include "io.h"</span></div> +<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div> +<div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="namespacezen.html"> 15</a></span> <span class="keyword">namespace </span>zen</div> +<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> {</div> +<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div> +<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">template</span> <<span class="keyword">class</span> String> <span class="keyword">inline</span></div> +<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="namespacezen.html#a872a48c0616e7f12ae8caca464835e00"> 33</a></span> <a class="code" href="classzen_1_1_xml_doc.html">XmlDoc</a> <a class="code" href="namespacezen.html#a872a48c0616e7f12ae8caca464835e00">load</a>(<span class="keyword">const</span> String& filename) <span class="comment">//throw XmlFileError, XmlParsingError</span></div> +<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> {</div> +<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  std::string stream = <a class="code" href="namespacezen.html#a04fe23c3bd9b7d03309620b5ea763607">loadStream</a>(filename); <span class="comment">//throw XmlFileError</span></div> +<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="keywordflow">return</span> <a class="code" href="namespacezen.html#a1ae1a4688d724b554fe3bf4638700477">parse</a>(stream); <span class="comment">//throw XmlParsingError</span></div> +<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> }</div> +<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div> +<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div> +<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div> +<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="keyword">template</span> <<span class="keyword">class</span> String> <span class="keyword">inline</span></div> +<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="namespacezen.html#adeeb6b2318097382ae47aa939fc15d4d"> 52</a></span> <span class="keywordtype">void</span> <a class="code" href="namespacezen.html#adeeb6b2318097382ae47aa939fc15d4d">save</a>(<span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_doc.html">XmlDoc</a>& doc,</div> +<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keyword">const</span> String& filename,</div> +<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keyword">const</span> std::string& lineBreak = <span class="stringliteral">"\r\n"</span>,</div> +<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keyword">const</span> std::string& indent = <span class="stringliteral">" "</span>) <span class="comment">//throw XmlFileError</span></div> +<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> {</div> +<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  std::string stream = <a class="code" href="namespacezen.html#afaa4920e275078e6c8009fbdf58b57ee">serialize</a>(doc, lineBreak, indent); <span class="comment">//throw ()</span></div> +<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <a class="code" href="namespacezen.html#a4ba7bbaa14a787b07fc13da9145aabe2">saveStream</a>(stream, filename); <span class="comment">//throw XmlFileError</span></div> +<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> }</div> +<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div> +<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div> +<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_out.html"> 63</a></span> <span class="keyword">class </span><a class="code" href="classzen_1_1_xml_out.html">XmlOut</a></div> +<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> {</div> +<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">public</span>:</div> +<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div> +<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_out.html#ad8b1ccb8f3d4e7b0ab2598597ea50bcc"> 88</a></span>  <a class="code" href="classzen_1_1_xml_out.html#ad8b1ccb8f3d4e7b0ab2598597ea50bcc">XmlOut</a>(<a class="code" href="classzen_1_1_xml_doc.html">XmlDoc</a>& doc) : ref_(&doc.root()) {}</div> +<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div> +<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_out.html#aa80be3a56f70a58d2730a763166088c0"> 93</a></span>  <a class="code" href="classzen_1_1_xml_out.html#aa80be3a56f70a58d2730a763166088c0">XmlOut</a>(<a class="code" href="classzen_1_1_xml_element.html">XmlElement</a>& element) : ref_(&element) {}</div> +<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div> +<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div> +<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keyword">template</span> <<span class="keyword">class</span> String></div> +<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_out.html#a00f883d3f9d60535b06b5ae609dc8831"> 102</a></span>  <a class="code" href="classzen_1_1_xml_out.html">XmlOut</a> <a class="code" href="classzen_1_1_xml_out.html#a00f883d3f9d60535b06b5ae609dc8831">operator[]</a>(<span class="keyword">const</span> String& name)<span class="keyword"> const</span></div> +<div class="line"><a name="l00103"></a><span class="lineno"> 103</span> <span class="keyword"> </span>{</div> +<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keyword">const</span> std::string utf8name = utfCvrtTo<std::string>(name);</div> +<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="classzen_1_1_xml_element.html">XmlElement</a>* child = ref_-><a class="code" href="classzen_1_1_xml_element.html#a3ab82b1720460487f4afabcd115d0c7e">getChild</a>(utf8name);</div> +<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">return</span> child ? *child : ref_-><a class="code" href="classzen_1_1_xml_element.html#a653caffa6fad89db7d14f67f987ad0f9">addChild</a>(utf8name);</div> +<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  }</div> +<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div> +<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> </div> +<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div> +<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_out.html#a09ca9144515e3c109b36062b0475c8eb"> 115</a></span>  <span class="keywordtype">void</span> <a class="code" href="classzen_1_1_xml_out.html#a09ca9144515e3c109b36062b0475c8eb">operator()</a>(<span class="keyword">const</span> T& value) { <a class="code" href="namespacezen.html#a29ddb823fe0a195f19a64448881b8bf6">writeStruc</a>(value, *ref_); }</div> +<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> </div> +<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div> +<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keyword">template</span> <<span class="keyword">class</span> String, <span class="keyword">class</span> T></div> +<div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_out.html#acaf9b71fe1d907dd63dd4b91e2e03805"> 143</a></span>  <span class="keywordtype">void</span> <a class="code" href="classzen_1_1_xml_out.html#acaf9b71fe1d907dd63dd4b91e2e03805">attribute</a>(<span class="keyword">const</span> String& name, <span class="keyword">const</span> T& value) { ref_-><a class="code" href="classzen_1_1_xml_element.html#a211a6f037c22a54d3facb7a8347a8421">setAttribute</a>(name, value); }</div> +<div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div> +<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_out.html#aec117344e8a534382e8d5e76711f97b2"> 146</a></span>  <a class="code" href="classzen_1_1_xml_element.html">XmlElement</a>& <a class="code" href="classzen_1_1_xml_out.html#aec117344e8a534382e8d5e76711f97b2">ref</a>() { <span class="keywordflow">return</span> *ref_; }</div> +<div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div> +<div class="line"><a name="l00148"></a><span class="lineno"> 148</span> <span class="keyword">private</span>:</div> +<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <a class="code" href="classzen_1_1_xml_element.html">XmlElement</a>* ref_; <span class="comment">//always bound!</span></div> +<div class="line"><a name="l00150"></a><span class="lineno"> 150</span> };</div> +<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> </div> +<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> </div> +<div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html"> 154</a></span> <span class="keyword">class </span><a class="code" href="classzen_1_1_xml_in.html">XmlIn</a></div> +<div class="line"><a name="l00155"></a><span class="lineno"> 155</span> {</div> +<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keyword">class </span>ErrorLog;</div> +<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keyword">struct </span>ConversionToBool { <span class="keywordtype">int</span> dummy; };</div> +<div class="line"><a name="l00158"></a><span class="lineno"> 158</span> </div> +<div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="keyword">public</span>:</div> +<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> </div> +<div class="line"><a name="l00171"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#a5b48c9848e6c631a04cec2477ff85c0f"> 171</a></span>  <a class="code" href="classzen_1_1_xml_in.html#a5b48c9848e6c631a04cec2477ff85c0f">XmlIn</a>(<span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_doc.html">XmlDoc</a>& doc) : refIndex(0), log(std::make_shared<ErrorLog>()) { refList.push_back(&doc.<a class="code" href="classzen_1_1_xml_doc.html#ad4a9594d93885fc1a12db28e8246648d">root</a>()); }</div> +<div class="line"><a name="l00173"></a><span class="lineno"> 173</span> </div> +<div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#ae072660cde71fd4695c04d074098b430"> 176</a></span>  <a class="code" href="classzen_1_1_xml_in.html#ae072660cde71fd4695c04d074098b430">XmlIn</a>(<span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_element.html">XmlElement</a>* element) : refIndex(0), log(std::make_shared<ErrorLog>()) { refList.push_back(element); }</div> +<div class="line"><a name="l00178"></a><span class="lineno"> 178</span> </div> +<div class="line"><a name="l00181"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#a33de75412df69cb25e0fd8b3bc70c9f8"> 181</a></span>  <a class="code" href="classzen_1_1_xml_in.html#a33de75412df69cb25e0fd8b3bc70c9f8">XmlIn</a>(<span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_element.html">XmlElement</a>& element) : refIndex(0), log(std::make_shared<ErrorLog>()) { refList.push_back(&element); }</div> +<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> </div> +<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> </div> +<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keyword">template</span> <<span class="keyword">class</span> String></div> +<div class="line"><a name="l00190"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#a9b38167835a28eac9a2297f35f51e53d"> 190</a></span>  <a class="code" href="classzen_1_1_xml_in.html">XmlIn</a> <a class="code" href="classzen_1_1_xml_in.html#a9b38167835a28eac9a2297f35f51e53d">operator[]</a>(<span class="keyword">const</span> String& name)<span class="keyword"> const</span></div> +<div class="line"><a name="l00191"></a><span class="lineno"> 191</span> <span class="keyword"> </span>{</div> +<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  std::vector<const XmlElement*> childList;</div> +<div class="line"><a name="l00193"></a><span class="lineno"> 193</span> </div> +<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keywordflow">if</span> (refIndex < refList.size())</div> +<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  {</div> +<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keyword">auto</span> iterPair = refList[refIndex]->getChildren(name);</div> +<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  std::for_each(iterPair.first, iterPair.second,</div> +<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  [&](<span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_element.html">XmlElement</a>& child) { childList.push_back(&child); });</div> +<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  }</div> +<div class="line"><a name="l00200"></a><span class="lineno"> 200</span> </div> +<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordflow">return</span> <a class="code" href="classzen_1_1_xml_in.html#a5b48c9848e6c631a04cec2477ff85c0f">XmlIn</a>(childList, childList.empty() ? getChildNameFormatted(name) : std::string(), log);</div> +<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  }</div> +<div class="line"><a name="l00203"></a><span class="lineno"> 203</span> </div> +<div class="line"><a name="l00205"></a><span class="lineno"> 205</span> </div> +<div class="line"><a name="l00225"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#a60cf2678c989621545d27745dcafa4a4"> 225</a></span>  <span class="keywordtype">void</span> <a class="code" href="classzen_1_1_xml_in.html#a60cf2678c989621545d27745dcafa4a4">next</a>() { ++refIndex; }</div> +<div class="line"><a name="l00226"></a><span class="lineno"> 226</span> </div> +<div class="line"><a name="l00228"></a><span class="lineno"> 228</span> </div> +<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T></div> +<div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#a98cc59f687c89549381e76105f8fb506"> 234</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classzen_1_1_xml_in.html#a98cc59f687c89549381e76105f8fb506">operator()</a>(T& value)<span class="keyword"> const</span></div> +<div class="line"><a name="l00235"></a><span class="lineno"> 235</span> <span class="keyword"> </span>{</div> +<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="keywordflow">if</span> (refIndex < refList.size())</div> +<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  {</div> +<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  <span class="keywordtype">bool</span> success = <a class="code" href="namespacezen.html#a2bdcecfe7435ef11cedbce47d4e72ee1">readStruc</a>(*refList[refIndex], value);</div> +<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keywordflow">if</span> (!success)</div> +<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  log->notifyConversionError(getNameFormatted());</div> +<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="keywordflow">return</span> success;</div> +<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  }</div> +<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <span class="keywordflow">else</span></div> +<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  {</div> +<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  log->notifyMissingElement(getNameFormatted());</div> +<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  }</div> +<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  }</div> +<div class="line"><a name="l00249"></a><span class="lineno"> 249</span> </div> +<div class="line"><a name="l00251"></a><span class="lineno"> 251</span> </div> +<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="keyword">template</span> <<span class="keyword">class</span> String, <span class="keyword">class</span> T></div> +<div class="line"><a name="l00269"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#a971cd7054c551c4460d5220f6ec5cf01"> 269</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classzen_1_1_xml_in.html#a971cd7054c551c4460d5220f6ec5cf01">attribute</a>(<span class="keyword">const</span> String& name, T& value)<span class="keyword"> const</span></div> +<div class="line"><a name="l00270"></a><span class="lineno"> 270</span> <span class="keyword"> </span>{</div> +<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="keywordflow">if</span> (refIndex < refList.size())</div> +<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  {</div> +<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="keywordtype">bool</span> success = refList[refIndex]->getAttribute(name, value);</div> +<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <span class="keywordflow">if</span> (!success)</div> +<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  log->notifyMissingAttribute(getNameFormatted(), utfCvrtTo<std::string>(name));</div> +<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <span class="keywordflow">return</span> success;</div> +<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  }</div> +<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="keywordflow">else</span></div> +<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  {</div> +<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  log->notifyMissingElement(getNameFormatted());</div> +<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  }</div> +<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  }</div> +<div class="line"><a name="l00284"></a><span class="lineno"> 284</span> </div> +<div class="line"><a name="l00286"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#a647b468b7c6c95b25f2e43627184177f"> 286</a></span>  <span class="keyword">const</span> <a class="code" href="classzen_1_1_xml_element.html">XmlElement</a>* <span class="keyword">get</span>() <span class="keyword">const</span> { <span class="keywordflow">return</span> refIndex < refList.size() ? refList[refIndex] : <span class="keyword">nullptr</span>; }</div> +<div class="line"><a name="l00287"></a><span class="lineno"> 287</span> </div> +<div class="line"><a name="l00289"></a><span class="lineno"> 289</span> </div> +<div class="line"><a name="l00298"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#a954950849b52557369932ab2a8b4ad72"> 298</a></span>  <span class="keyword">operator</span> <span class="keywordtype">int</span> ConversionToBool::* () <span class="keyword">const</span> { <span class="keywordflow">return</span> <span class="keyword">get</span>() ? &ConversionToBool::dummy : <span class="keyword">nullptr</span>; }</div> +<div class="line"><a name="l00299"></a><span class="lineno"> 299</span> </div> +<div class="line"><a name="l00301"></a><span class="lineno"> 301</span> </div> +<div class="line"><a name="l00320"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#a33b5dd504d3165aa3f923f6b33e9991a"> 320</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classzen_1_1_xml_in.html#a33b5dd504d3165aa3f923f6b33e9991a">errorsOccured</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !log->elementList().empty(); }</div> +<div class="line"><a name="l00321"></a><span class="lineno"> 321</span> </div> +<div class="line"><a name="l00323"></a><span class="lineno"> 323</span> </div> +<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <span class="keyword">template</span> <<span class="keyword">class</span> String></div> +<div class="line"><a name="l00328"></a><span class="lineno"><a class="line" href="classzen_1_1_xml_in.html#a84bb497d3b3fc753d054e52c4823c05e"> 328</a></span>  std::vector<String> <a class="code" href="classzen_1_1_xml_in.html#a84bb497d3b3fc753d054e52c4823c05e">getErrorsAs</a>()<span class="keyword"> const</span></div> +<div class="line"><a name="l00329"></a><span class="lineno"> 329</span> <span class="keyword"> </span>{</div> +<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  std::vector<String> output;</div> +<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  <span class="keyword">const</span> <span class="keyword">auto</span>& elements = log->elementList();</div> +<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  std::transform(elements.begin(), elements.end(), std::back_inserter(output), [](<span class="keyword">const</span> std::string& str) { <span class="keywordflow">return</span> utfCvrtTo<String>(str); });</div> +<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  <span class="keywordflow">return</span> output;</div> +<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  }</div> +<div class="line"><a name="l00335"></a><span class="lineno"> 335</span> </div> +<div class="line"><a name="l00336"></a><span class="lineno"> 336</span> <span class="keyword">private</span>:</div> +<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  <a class="code" href="classzen_1_1_xml_in.html">XmlIn</a>(<span class="keyword">const</span> std::vector<const XmlElement*>& siblingList, <span class="keyword">const</span> std::string& elementNameFmt, <span class="keyword">const</span> std::shared_ptr<ErrorLog>& sharedlog) :</div> +<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  refList(siblingList), refIndex(0), formattedName(elementNameFmt), log(sharedlog)</div> +<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  { assert((!siblingList.empty() && elementNameFmt.empty()) || (siblingList.empty() && !elementNameFmt.empty())); }</div> +<div class="line"><a name="l00340"></a><span class="lineno"> 340</span> </div> +<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="keyword">static</span> std::string getNameFormatted(<span class="keyword">const</span> XmlElement& elem) <span class="comment">//"<Root> <Level1> <Level2>"</span></div> +<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  {</div> +<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <span class="keywordflow">return</span> (elem.parent() ? getNameFormatted(*elem.parent()) + <span class="stringliteral">" "</span> : std::string()) + <span class="stringliteral">"<"</span> + elem.getNameAs<std::string>() + <span class="stringliteral">">"</span>;</div> +<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  }</div> +<div class="line"><a name="l00345"></a><span class="lineno"> 345</span> </div> +<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  std::string getNameFormatted()<span class="keyword"> const</span></div> +<div class="line"><a name="l00347"></a><span class="lineno"> 347</span> <span class="keyword"> </span>{</div> +<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <span class="keywordflow">if</span> (refIndex < refList.size())</div> +<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  {</div> +<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  assert(formattedName.empty());</div> +<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  <span class="keywordflow">return</span> getNameFormatted(*refList[refIndex]);</div> +<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  }</div> +<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <span class="keywordflow">else</span></div> +<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  <span class="keywordflow">return</span> formattedName;</div> +<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  }</div> +<div class="line"><a name="l00356"></a><span class="lineno"> 356</span> </div> +<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  std::string getChildNameFormatted(<span class="keyword">const</span> std::string& childName)<span class="keyword"> const</span></div> +<div class="line"><a name="l00358"></a><span class="lineno"> 358</span> <span class="keyword"> </span>{</div> +<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  std::string parentName = getNameFormatted();</div> +<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="keywordflow">return</span> (parentName.empty() ? std::string() : (parentName + <span class="stringliteral">" "</span>)) + <span class="stringliteral">"<"</span> + childName + <span class="stringliteral">">"</span>;</div> +<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  }</div> +<div class="line"><a name="l00362"></a><span class="lineno"> 362</span> </div> +<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  <span class="keyword">class </span>ErrorLog</div> +<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  {</div> +<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  <span class="keyword">public</span>:</div> +<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <span class="keywordtype">void</span> notifyConversionError (<span class="keyword">const</span> std::string& formattedName) { insert(formattedName); }</div> +<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  <span class="keywordtype">void</span> notifyMissingElement (<span class="keyword">const</span> std::string& formattedName) { insert(formattedName); }</div> +<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  <span class="keywordtype">void</span> notifyMissingAttribute(<span class="keyword">const</span> std::string& formattedName, <span class="keyword">const</span> std::string& attribName) { insert(formattedName + <span class="stringliteral">" @"</span> + attribName); }</div> +<div class="line"><a name="l00369"></a><span class="lineno"> 369</span> </div> +<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  <span class="keyword">const</span> std::vector<std::string>& elementList()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> failedElements; }</div> +<div class="line"><a name="l00371"></a><span class="lineno"> 371</span> </div> +<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <span class="keyword">private</span>:</div> +<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  <span class="keywordtype">void</span> insert(<span class="keyword">const</span> std::string& newVal)</div> +<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  {</div> +<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  <span class="keywordflow">if</span> (usedElements.insert(newVal).second)</div> +<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  failedElements.push_back(newVal);</div> +<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  }</div> +<div class="line"><a name="l00378"></a><span class="lineno"> 378</span> </div> +<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  std::vector<std::string> failedElements; <span class="comment">//unique list of failed elements</span></div> +<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  std::set<std::string> usedElements;</div> +<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  };</div> +<div class="line"><a name="l00382"></a><span class="lineno"> 382</span> </div> +<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  std::vector<const XmlElement*> refList; <span class="comment">//all sibling elements with same name (all pointers bound!)</span></div> +<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  <span class="keywordtype">size_t</span> refIndex; <span class="comment">//this sibling's index in refList</span></div> +<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  std::string formattedName; <span class="comment">//contains full and formatted element name if (and only if) refList is empty</span></div> +<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  std::shared_ptr<ErrorLog> log; <span class="comment">//always bound</span></div> +<div class="line"><a name="l00387"></a><span class="lineno"> 387</span> };</div> +<div class="line"><a name="l00388"></a><span class="lineno"> 388</span> }</div> +<div class="line"><a name="l00389"></a><span class="lineno"> 389</span> </div> +<div class="line"><a name="l00390"></a><span class="lineno"> 390</span> <span class="preprocessor">#endif //ZEN_XML_BIND_HEADER_9081740816593478258435</span></div> +<div class="ttc" id="classzen_1_1_xml_in_html_a33b5dd504d3165aa3f923f6b33e9991a"><div class="ttname"><a href="classzen_1_1_xml_in.html#a33b5dd504d3165aa3f923f6b33e9991a">zen::XmlIn::errorsOccured</a></div><div class="ttdeci">bool errorsOccured() const </div><div class="ttdoc">Notifies errors while mapping the XML to user data. </div><div class="ttdef"><b>Definition:</b> bind.h:320</div></div> +<div class="ttc" id="namespacezen_html_adeeb6b2318097382ae47aa939fc15d4d"><div class="ttname"><a href="namespacezen.html#adeeb6b2318097382ae47aa939fc15d4d">zen::save</a></div><div class="ttdeci">void save(const XmlDoc &doc, const String &filename, const std::string &lineBreak="\r\n", const std::string &indent=" ")</div><div class="ttdoc">Save XML document to a file. </div><div class="ttdef"><b>Definition:</b> bind.h:52</div></div> +<div class="ttc" id="classzen_1_1_xml_doc_html_ad4a9594d93885fc1a12db28e8246648d"><div class="ttname"><a href="classzen_1_1_xml_doc.html#ad4a9594d93885fc1a12db28e8246648d">zen::XmlDoc::root</a></div><div class="ttdeci">const XmlElement & root() const </div><div class="ttdoc">Get a const reference to the document's root element. </div><div class="ttdef"><b>Definition:</b> dom.h:267</div></div> +<div class="ttc" id="namespacezen_html_a1ae1a4688d724b554fe3bf4638700477"><div class="ttname"><a href="namespacezen.html#a1ae1a4688d724b554fe3bf4638700477">zen::parse</a></div><div class="ttdeci">XmlDoc parse(const std::string &stream)</div><div class="ttdoc">Load XML document from a byte stream. </div><div class="ttdef"><b>Definition:</b> parser.h:612</div></div> +<div class="ttc" id="namespacezen_html_afaa4920e275078e6c8009fbdf58b57ee"><div class="ttname"><a href="namespacezen.html#afaa4920e275078e6c8009fbdf58b57ee">zen::serialize</a></div><div class="ttdeci">std::string serialize(const XmlDoc &doc, const std::string &lineBreak="\r\n", const std::string &indent=" ")</div><div class="ttdoc">Save XML document as a byte stream. </div><div class="ttdef"><b>Definition:</b> parser.h:287</div></div> +<div class="ttc" id="classzen_1_1_xml_out_html_ad8b1ccb8f3d4e7b0ab2598597ea50bcc"><div class="ttname"><a href="classzen_1_1_xml_out.html#ad8b1ccb8f3d4e7b0ab2598597ea50bcc">zen::XmlOut::XmlOut</a></div><div class="ttdeci">XmlOut(XmlDoc &doc)</div><div class="ttdoc">Construct an output proxy for an XML document. </div><div class="ttdef"><b>Definition:</b> bind.h:88</div></div> +<div class="ttc" id="classzen_1_1_xml_out_html_aec117344e8a534382e8d5e76711f97b2"><div class="ttname"><a href="classzen_1_1_xml_out.html#aec117344e8a534382e8d5e76711f97b2">zen::XmlOut::ref</a></div><div class="ttdeci">XmlElement & ref()</div><div class="ttdoc">Return a reference to the underlying Xml element. </div><div class="ttdef"><b>Definition:</b> bind.h:146</div></div> +<div class="ttc" id="namespacezen_html_a4ba7bbaa14a787b07fc13da9145aabe2"><div class="ttname"><a href="namespacezen.html#a4ba7bbaa14a787b07fc13da9145aabe2">zen::saveStream</a></div><div class="ttdeci">void saveStream(const std::string &stream, const String &filename)</div><div class="ttdoc">Save byte stream to a file. </div><div class="ttdef"><b>Definition:</b> io.h:66</div></div> +<div class="ttc" id="classzen_1_1_xml_in_html"><div class="ttname"><a href="classzen_1_1_xml_in.html">zen::XmlIn</a></div><div class="ttdoc">Proxy class to conveniently convert XML structure to user data. </div><div class="ttdef"><b>Definition:</b> bind.h:154</div></div> +<div class="ttc" id="classzen_1_1_xml_out_html_a09ca9144515e3c109b36062b0475c8eb"><div class="ttname"><a href="classzen_1_1_xml_out.html#a09ca9144515e3c109b36062b0475c8eb">zen::XmlOut::operator()</a></div><div class="ttdeci">void operator()(const T &value)</div><div class="ttdoc">Write user data to the underlying XML element. </div><div class="ttdef"><b>Definition:</b> bind.h:115</div></div> +<div class="ttc" id="namespacezen_html_a04fe23c3bd9b7d03309620b5ea763607"><div class="ttname"><a href="namespacezen.html#a04fe23c3bd9b7d03309620b5ea763607">zen::loadStream</a></div><div class="ttdeci">std::string loadStream(const String &filename)</div><div class="ttdoc">Load byte stream from a file. </div><div class="ttdef"><b>Definition:</b> io.h:94</div></div> +<div class="ttc" id="classzen_1_1_xml_in_html_a5b48c9848e6c631a04cec2477ff85c0f"><div class="ttname"><a href="classzen_1_1_xml_in.html#a5b48c9848e6c631a04cec2477ff85c0f">zen::XmlIn::XmlIn</a></div><div class="ttdeci">XmlIn(const XmlDoc &doc)</div><div class="ttdoc">Construct an input proxy for an XML document. </div><div class="ttdef"><b>Definition:</b> bind.h:171</div></div> +<div class="ttc" id="classzen_1_1_xml_in_html_a33de75412df69cb25e0fd8b3bc70c9f8"><div class="ttname"><a href="classzen_1_1_xml_in.html#a33de75412df69cb25e0fd8b3bc70c9f8">zen::XmlIn::XmlIn</a></div><div class="ttdeci">XmlIn(const XmlElement &element)</div><div class="ttdoc">Construct an input proxy for a single XML element. </div><div class="ttdef"><b>Definition:</b> bind.h:181</div></div> +<div class="ttc" id="classzen_1_1_xml_in_html_a60cf2678c989621545d27745dcafa4a4"><div class="ttname"><a href="classzen_1_1_xml_in.html#a60cf2678c989621545d27745dcafa4a4">zen::XmlIn::next</a></div><div class="ttdeci">void next()</div><div class="ttdoc">Refer to next sibling element with the same name. </div><div class="ttdef"><b>Definition:</b> bind.h:225</div></div> +<div class="ttc" id="classzen_1_1_xml_element_html"><div class="ttname"><a href="classzen_1_1_xml_element.html">zen::XmlElement</a></div><div class="ttdoc">An XML element. </div><div class="ttdef"><b>Definition:</b> dom.h:21</div></div> +<div class="ttc" id="classzen_1_1_xml_out_html_acaf9b71fe1d907dd63dd4b91e2e03805"><div class="ttname"><a href="classzen_1_1_xml_out.html#acaf9b71fe1d907dd63dd4b91e2e03805">zen::XmlOut::attribute</a></div><div class="ttdeci">void attribute(const String &name, const T &value)</div><div class="ttdoc">Write user data to an XML attribute. </div><div class="ttdef"><b>Definition:</b> bind.h:143</div></div> +<div class="ttc" id="classzen_1_1_xml_in_html_a9b38167835a28eac9a2297f35f51e53d"><div class="ttname"><a href="classzen_1_1_xml_in.html#a9b38167835a28eac9a2297f35f51e53d">zen::XmlIn::operator[]</a></div><div class="ttdeci">XmlIn operator[](const String &name) const </div><div class="ttdoc">Retrieve a handle to an XML child element for reading. </div><div class="ttdef"><b>Definition:</b> bind.h:190</div></div> +<div class="ttc" id="classzen_1_1_xml_doc_html"><div class="ttname"><a href="classzen_1_1_xml_doc.html">zen::XmlDoc</a></div><div class="ttdoc">The complete XML document. </div><div class="ttdef"><b>Definition:</b> dom.h:249</div></div> +<div class="ttc" id="classzen_1_1_xml_in_html_a971cd7054c551c4460d5220f6ec5cf01"><div class="ttname"><a href="classzen_1_1_xml_in.html#a971cd7054c551c4460d5220f6ec5cf01">zen::XmlIn::attribute</a></div><div class="ttdeci">bool attribute(const String &name, T &value) const </div><div class="ttdoc">Read user data from an XML attribute. </div><div class="ttdef"><b>Definition:</b> bind.h:269</div></div> +<div class="ttc" id="classzen_1_1_xml_in_html_a84bb497d3b3fc753d054e52c4823c05e"><div class="ttname"><a href="classzen_1_1_xml_in.html#a84bb497d3b3fc753d054e52c4823c05e">zen::XmlIn::getErrorsAs</a></div><div class="ttdeci">std::vector< String > getErrorsAs() const </div><div class="ttdoc">Get a list of XML element and attribute names which failed to convert to user data. </div><div class="ttdef"><b>Definition:</b> bind.h:328</div></div> +<div class="ttc" id="classzen_1_1_xml_out_html"><div class="ttname"><a href="classzen_1_1_xml_out.html">zen::XmlOut</a></div><div class="ttdoc">Proxy class to conveniently convert user data into XML structure. </div><div class="ttdef"><b>Definition:</b> bind.h:63</div></div> +<div class="ttc" id="classzen_1_1_xml_in_html_a98cc59f687c89549381e76105f8fb506"><div class="ttname"><a href="classzen_1_1_xml_in.html#a98cc59f687c89549381e76105f8fb506">zen::XmlIn::operator()</a></div><div class="ttdeci">bool operator()(T &value) const </div><div class="ttdoc">Read user data from the underlying XML element. </div><div class="ttdef"><b>Definition:</b> bind.h:234</div></div> +<div class="ttc" id="classzen_1_1_xml_element_html_a653caffa6fad89db7d14f67f987ad0f9"><div class="ttname"><a href="classzen_1_1_xml_element.html#a653caffa6fad89db7d14f67f987ad0f9">zen::XmlElement::addChild</a></div><div class="ttdeci">XmlElement & addChild(const String &name)</div><div class="ttdoc">Create a new child element and return a reference to it. </div><div class="ttdef"><b>Definition:</b> dom.h:97</div></div> +<div class="ttc" id="classzen_1_1_xml_element_html_a3ab82b1720460487f4afabcd115d0c7e"><div class="ttname"><a href="classzen_1_1_xml_element.html#a3ab82b1720460487f4afabcd115d0c7e">zen::XmlElement::getChild</a></div><div class="ttdeci">const XmlElement * getChild(const String &name) const </div><div class="ttdoc">Retrieve a child element with the given name. </div><div class="ttdef"><b>Definition:</b> dom.h:113</div></div> +<div class="ttc" id="namespacezen_html_a2bdcecfe7435ef11cedbce47d4e72ee1"><div class="ttname"><a href="namespacezen.html#a2bdcecfe7435ef11cedbce47d4e72ee1">zen::readStruc</a></div><div class="ttdeci">bool readStruc(const XmlElement &input, T &value)</div><div class="ttdoc">Convert XML element to structured user data. </div><div class="ttdef"><b>Definition:</b> cvrt_struc.h:205</div></div> +<div class="ttc" id="classzen_1_1_xml_element_html_a211a6f037c22a54d3facb7a8347a8421"><div class="ttname"><a href="classzen_1_1_xml_element.html#a211a6f037c22a54d3facb7a8347a8421">zen::XmlElement::setAttribute</a></div><div class="ttdeci">void setAttribute(const String &name, const T &value)</div><div class="ttdoc">Create or update an XML attribute. </div><div class="ttdef"><b>Definition:</b> dom.h:77</div></div> +<div class="ttc" id="namespacezen_html_a29ddb823fe0a195f19a64448881b8bf6"><div class="ttname"><a href="namespacezen.html#a29ddb823fe0a195f19a64448881b8bf6">zen::writeStruc</a></div><div class="ttdeci">void writeStruc(const T &value, XmlElement &output)</div><div class="ttdoc">Convert structured user data into an XML element. </div><div class="ttdef"><b>Definition:</b> cvrt_struc.h:198</div></div> +<div class="ttc" id="classzen_1_1_xml_out_html_a00f883d3f9d60535b06b5ae609dc8831"><div class="ttname"><a href="classzen_1_1_xml_out.html#a00f883d3f9d60535b06b5ae609dc8831">zen::XmlOut::operator[]</a></div><div class="ttdeci">XmlOut operator[](const String &name) const </div><div class="ttdoc">Retrieve a handle to an XML child element for writing. </div><div class="ttdef"><b>Definition:</b> bind.h:102</div></div> +<div class="ttc" id="classzen_1_1_xml_in_html_ae072660cde71fd4695c04d074098b430"><div class="ttname"><a href="classzen_1_1_xml_in.html#ae072660cde71fd4695c04d074098b430">zen::XmlIn::XmlIn</a></div><div class="ttdeci">XmlIn(const XmlElement *element)</div><div class="ttdoc">Construct an input proxy for a single XML element, may be nullptr. </div><div class="ttdef"><b>Definition:</b> bind.h:176</div></div> +<div class="ttc" id="classzen_1_1_xml_out_html_aa80be3a56f70a58d2730a763166088c0"><div class="ttname"><a href="classzen_1_1_xml_out.html#aa80be3a56f70a58d2730a763166088c0">zen::XmlOut::XmlOut</a></div><div class="ttdeci">XmlOut(XmlElement &element)</div><div class="ttdoc">Construct an output proxy for a single XML element. </div><div class="ttdef"><b>Definition:</b> bind.h:93</div></div> +<div class="ttc" id="namespacezen_html_a872a48c0616e7f12ae8caca464835e00"><div class="ttname"><a href="namespacezen.html#a872a48c0616e7f12ae8caca464835e00">zen::load</a></div><div class="ttdeci">XmlDoc load(const String &filename)</div><div class="ttdoc">Load XML document from a file. </div><div class="ttdef"><b>Definition:</b> bind.h:33</div></div> +</div><!-- fragment --></div><!-- contents --> +<!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> -</a> 1.8.0 +</a> 1.8.6 </small></address> - </body> </html> |