1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<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: zen::XmlOut Class Reference</title>
<link href="tabs.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, 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>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</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><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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacezen.html">zen</a></li><li class="navelem"><a class="el" href="classzen_1_1_xml_out.html">XmlOut</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classzen_1_1_xml_out-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">zen::XmlOut Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Proxy class to conveniently convert user data into XML structure.
<a href="classzen_1_1_xml_out.html#details">More...</a></p>
<p><code>#include <<a class="el" href="bind_8h_source.html">bind.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad8b1ccb8f3d4e7b0ab2598597ea50bcc"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classzen_1_1_xml_out.html#ad8b1ccb8f3d4e7b0ab2598597ea50bcc">XmlOut</a> (<a class="el" href="classzen_1_1_xml_doc.html">XmlDoc</a> &doc)</td></tr>
<tr class="memdesc:ad8b1ccb8f3d4e7b0ab2598597ea50bcc"><td class="mdescLeft"> </td><td class="mdescRight">Construct an output proxy for an XML document. <a href="#ad8b1ccb8f3d4e7b0ab2598597ea50bcc">More...</a><br/></td></tr>
<tr class="separator:ad8b1ccb8f3d4e7b0ab2598597ea50bcc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa80be3a56f70a58d2730a763166088c0"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classzen_1_1_xml_out.html#aa80be3a56f70a58d2730a763166088c0">XmlOut</a> (<a class="el" href="classzen_1_1_xml_element.html">XmlElement</a> &element)</td></tr>
<tr class="memdesc:aa80be3a56f70a58d2730a763166088c0"><td class="mdescLeft"> </td><td class="mdescRight">Construct an output proxy for a single XML element. <a href="#aa80be3a56f70a58d2730a763166088c0">More...</a><br/></td></tr>
<tr class="separator:aa80be3a56f70a58d2730a763166088c0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a00f883d3f9d60535b06b5ae609dc8831"><td class="memTemplParams" colspan="2">template<class String > </td></tr>
<tr class="memitem:a00f883d3f9d60535b06b5ae609dc8831"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classzen_1_1_xml_out.html">XmlOut</a> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classzen_1_1_xml_out.html#a00f883d3f9d60535b06b5ae609dc8831">operator[]</a> (const String &name) const </td></tr>
<tr class="memdesc:a00f883d3f9d60535b06b5ae609dc8831"><td class="mdescLeft"> </td><td class="mdescRight">Retrieve a handle to an XML child element for writing. <a href="#a00f883d3f9d60535b06b5ae609dc8831">More...</a><br/></td></tr>
<tr class="separator:a00f883d3f9d60535b06b5ae609dc8831"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a09ca9144515e3c109b36062b0475c8eb"><td class="memTemplParams" colspan="2">template<class T > </td></tr>
<tr class="memitem:a09ca9144515e3c109b36062b0475c8eb"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classzen_1_1_xml_out.html#a09ca9144515e3c109b36062b0475c8eb">operator()</a> (const T &value)</td></tr>
<tr class="memdesc:a09ca9144515e3c109b36062b0475c8eb"><td class="mdescLeft"> </td><td class="mdescRight">Write user data to the underlying XML element. <a href="#a09ca9144515e3c109b36062b0475c8eb">More...</a><br/></td></tr>
<tr class="separator:a09ca9144515e3c109b36062b0475c8eb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acaf9b71fe1d907dd63dd4b91e2e03805"><td class="memTemplParams" colspan="2">template<class String , class T > </td></tr>
<tr class="memitem:acaf9b71fe1d907dd63dd4b91e2e03805"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classzen_1_1_xml_out.html#acaf9b71fe1d907dd63dd4b91e2e03805">attribute</a> (const String &name, const T &value)</td></tr>
<tr class="memdesc:acaf9b71fe1d907dd63dd4b91e2e03805"><td class="mdescLeft"> </td><td class="mdescRight">Write user data to an XML attribute. <a href="#acaf9b71fe1d907dd63dd4b91e2e03805">More...</a><br/></td></tr>
<tr class="separator:acaf9b71fe1d907dd63dd4b91e2e03805"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aec117344e8a534382e8d5e76711f97b2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aec117344e8a534382e8d5e76711f97b2"></a>
<a class="el" href="classzen_1_1_xml_element.html">XmlElement</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classzen_1_1_xml_out.html#aec117344e8a534382e8d5e76711f97b2">ref</a> ()</td></tr>
<tr class="memdesc:aec117344e8a534382e8d5e76711f97b2"><td class="mdescLeft"> </td><td class="mdescRight">Return a reference to the underlying Xml element. <br/></td></tr>
<tr class="separator:aec117344e8a534382e8d5e76711f97b2"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Proxy class to conveniently convert user data into XML structure. </p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="ad8b1ccb8f3d4e7b0ab2598597ea50bcc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">zen::XmlOut::XmlOut </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classzen_1_1_xml_doc.html">XmlDoc</a> & </td>
<td class="paramname"><em>doc</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct an output proxy for an XML document. </p>
<div class="fragment"><div class="line"><a class="code" href="classzen_1_1_xml_doc.html">zen::XmlDoc</a> doc;</div>
<div class="line"></div>
<div class="line"><a class="code" href="classzen_1_1_xml_out.html">zen::XmlOut</a> out(doc);</div>
<div class="line">out[<span class="stringliteral">"elem1"</span>]( 1); <span class="comment">//</span></div>
<div class="line">out[<span class="stringliteral">"elem2"</span>]( 2); <span class="comment">//write data into XML elements</span></div>
<div class="line">out[<span class="stringliteral">"elem3"</span>](-3); <span class="comment">//</span></div>
<div class="line"></div>
<div class="line"><a class="code" href="namespacezen.html#adeeb6b2318097382ae47aa939fc15d4d">save</a>(doc, <span class="stringliteral">"out.xml"</span>); <span class="comment">//throw XmlFileError</span></div>
</div><!-- fragment --><p> Output: </p>
<pre class="fragment"><?xml version="1.0" encoding="UTF-8"?>
<Root>
<elem1>1</elem1>
<elem2>2</elem2>
<elem3>-3</elem3>
</Root>
</pre>
</div>
</div>
<a class="anchor" id="aa80be3a56f70a58d2730a763166088c0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">zen::XmlOut::XmlOut </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classzen_1_1_xml_element.html">XmlElement</a> & </td>
<td class="paramname"><em>element</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct an output proxy for a single XML element. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classzen_1_1_xml_out.html#ad8b1ccb8f3d4e7b0ab2598597ea50bcc" title="Construct an output proxy for an XML document. ">XmlOut(XmlDoc& doc)</a> </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="acaf9b71fe1d907dd63dd4b91e2e03805"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class String , class T > </div>
<table class="memname">
<tr>
<td class="memname">void zen::XmlOut::attribute </td>
<td>(</td>
<td class="paramtype">const String & </td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const T & </td>
<td class="paramname"><em>value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Write user data to an XML attribute. </p>
<p>This conversion requires a specialization of <a class="el" href="namespacezen.html#a2ce2998296871fc2f4718ceceb22a23f" title="Convert user data into text - used by XML elements and attributes. ">zen::writeText()</a> for type T. </p>
<div class="fragment"><div class="line"><a class="code" href="classzen_1_1_xml_doc.html">zen::XmlDoc</a> doc;</div>
<div class="line"></div>
<div class="line"><a class="code" href="classzen_1_1_xml_out.html">zen::XmlOut</a> out(doc);</div>
<div class="line">out[<span class="stringliteral">"elem"</span>].attribute(<span class="stringliteral">"attr1"</span>, 1); <span class="comment">//</span></div>
<div class="line">out[<span class="stringliteral">"elem"</span>].attribute(<span class="stringliteral">"attr2"</span>, 2); <span class="comment">//write data into XML attributes</span></div>
<div class="line">out[<span class="stringliteral">"elem"</span>].attribute(<span class="stringliteral">"attr3"</span>, -3); <span class="comment">//</span></div>
<div class="line"></div>
<div class="line"><a class="code" href="namespacezen.html#adeeb6b2318097382ae47aa939fc15d4d">save</a>(doc, <span class="stringliteral">"out.xml"</span>); <span class="comment">//throw XmlFileError</span></div>
</div><!-- fragment --><p> Output: </p>
<pre class="fragment"> <?xml version="1.0" encoding="UTF-8"?>
<Root>
<elem attr1="1" attr2="2" attr3="-3"/>
</Root></pre><dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">String</td><td>Arbitrary string-like type: e.g. std::string, wchar_t*, char[], wchar_t, wxString, MyStringClass, ... </td></tr>
<tr><td class="paramname">T</td><td>String-convertible user data type: e.g. any string-like type, all built-in arithmetic numbers </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classzen_1_1_xml_element.html#a211a6f037c22a54d3facb7a8347a8421" title="Create or update an XML attribute. ">XmlElement::setAttribute()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a09ca9144515e3c109b36062b0475c8eb"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class T > </div>
<table class="memname">
<tr>
<td class="memname">void zen::XmlOut::operator() </td>
<td>(</td>
<td class="paramtype">const T & </td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Write user data to the underlying XML element. </p>
<p>This conversion requires a specialization of <a class="el" href="namespacezen.html#a2ce2998296871fc2f4718ceceb22a23f" title="Convert user data into text - used by XML elements and attributes. ">zen::writeText()</a> or <a class="el" href="namespacezen.html#a29ddb823fe0a195f19a64448881b8bf6" title="Convert structured user data into an XML element. ">zen::writeStruc()</a> for type T. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">T</td><td>User type that is converted into an XML element value. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a00f883d3f9d60535b06b5ae609dc8831"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class String > </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classzen_1_1_xml_out.html">XmlOut</a> zen::XmlOut::operator[] </td>
<td>(</td>
<td class="paramtype">const String & </td>
<td class="paramname"><em>name</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieve a handle to an XML child element for writing. </p>
<p>The child element will be created if it is not yet existing. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">String</td><td>Arbitrary string-like type: e.g. std::string, wchar_t*, char[], wchar_t, wxString, MyStringClass, ... </td></tr>
</table>
</dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td>The name of the child element </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</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.6
</small></address>
</body>
</html>
|