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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
|
<!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"/>
<title>TinyXml: TiXmlDocument Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</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>
</div>
<div class="contents">
<h1>TiXmlDocument Class Reference</h1><!-- doxytag: class="TiXmlDocument" --><!-- doxytag: inherits="TiXmlNode" -->
<p>Always the top level node.
<a href="#_details">More...</a></p>
<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for TiXmlDocument:</div>
<div class="dynsection">
<div class="center">
<img src="classTiXmlDocument.png" usemap="#TiXmlDocument_map" alt=""/>
<map id="TiXmlDocument_map" name="TiXmlDocument_map">
<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,99,80"/>
<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,99,24"/>
</map>
</div>
</div>
<p><a href="classTiXmlDocument-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9f5e84335708fde98400230f9f12659c"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="a9f5e84335708fde98400230f9f12659c" args="()" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a9f5e84335708fde98400230f9f12659c">TiXmlDocument</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an empty document, that has no name. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae4508b452d0c3061db085f3db27b8396"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="ae4508b452d0c3061db085f3db27b8396" args="(const char *documentName)" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ae4508b452d0c3061db085f3db27b8396">TiXmlDocument</a> (const char *documentName)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a document with a name. The name of the document is also the filename of the xml. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2c6e58fb99bfa76cc613f16840022225"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="a2c6e58fb99bfa76cc613f16840022225" args="(const std::string &documentName)" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a2c6e58fb99bfa76cc613f16840022225">TiXmlDocument</a> (const std::string &documentName)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f">LoadFile</a> (TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a file using the current document value. <a href="#a4c852a889c02cf251117fd1d9fe1845f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a21c0aeb0d0a720169ad4ac89523ebe93"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="a21c0aeb0d0a720169ad4ac89523ebe93" args="() const " -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a file using the current document value. Returns true if successful. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a879cdf5e981b8b2d2ef82f2546dd28fb"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a879cdf5e981b8b2d2ef82f2546dd28fb" args="(const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a879cdf5e981b8b2d2ef82f2546dd28fb">LoadFile</a> (const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a file using the given filename. Returns true if successful. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae869f5ebf7fc54c4a1d737fb4689fd44"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="ae869f5ebf7fc54c4a1d737fb4689fd44" args="(const char *filename) const " -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ae869f5ebf7fc54c4a1d737fb4689fd44">SaveFile</a> (const char *filename) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a file using the given filename. Returns true if successful. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a41f6fe7200864d1dca663d230caf8db6">LoadFile</a> (FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a file using the given FILE*. <a href="#a41f6fe7200864d1dca663d230caf8db6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acf1672b4538c6d1d441f9f108aea2bf4"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="acf1672b4538c6d1d441f9f108aea2bf4" args="(FILE *) const " -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#acf1672b4538c6d1d441f9f108aea2bf4">SaveFile</a> (FILE *) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a file using the given FILE*. Returns true if successful. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a18ae6ed34fed7991ebc220862dfac884">LoadFile</a> (const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3d4fae0463f3f03679ba0b7cf6f2df52"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="a3d4fae0463f3f03679ba0b7cf6f2df52" args="(const std::string &filename) const " -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a3d4fae0463f3f03679ba0b7cf6f2df52">SaveFile</a> (const std::string &filename) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">< STL std::string version. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a17ebabe36926ef398e78dec0d0ad0378">Parse</a> (const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Parse the given null terminated block of xml data. <a href="#a17ebabe36926ef398e78dec0d0ad0378"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ad09d17927f908f40efb406af2fb873be">RootElement</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the root element -- the only top level element -- of the document. <a href="#ad09d17927f908f40efb406af2fb873be"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a6dfc01a6e5d58e56acd537dfd3bdeb29">Error</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">If an error occurs, Error will be set to true. <a href="#a6dfc01a6e5d58e56acd537dfd3bdeb29"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9d0f689f6e09ea494ea547be8d79c25e"></a><!-- doxytag: member="TiXmlDocument::ErrorDesc" ref="a9d0f689f6e09ea494ea547be8d79c25e" args="() const " -->
const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Contains a textual (english) description of the error if one occurs. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#af96fc2f3f9ec6422782bfe916c9e778f">ErrorId</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Generally, you probably want the error string ( <a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e" title="Contains a textual (english) description of the error if one occurs.">ErrorDesc()</a> ). <a href="#af96fc2f3f9ec6422782bfe916c9e778f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e">ErrorRow</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the location (if known) of the error. <a href="#af30efc75e804aa2e92fb8be3a8cb676e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa90bc630ee5203c6109ca5fad3323649"></a><!-- doxytag: member="TiXmlDocument::ErrorCol" ref="aa90bc630ee5203c6109ca5fad3323649" args="() const " -->
int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649">ErrorCol</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The column where the error occured. See <a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e" title="Returns the location (if known) of the error.">ErrorRow()</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e">SetTabSize</a> (int _tabsize)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e" title="SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to...">SetTabSize()</a> allows the error reporting functions (<a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e" title="Returns the location (if known) of the error.">ErrorRow()</a> and <a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649" title="The column where the error occured. See ErrorRow().">ErrorCol()</a>) to report the correct values for row and column. <a href="#a51dac56316f89b35bdb7d0d433ba988e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ac66b8c28db86363315712a3574e87c35">ClearError</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">If you have handled the error, it can be reset with this call. <a href="#ac66b8c28db86363315712a3574e87c35"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#af08389ec70ee9b2de7f800e206a18510">Print</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Write the document to standard out using formatted printing ("pretty print"). <a href="#af08389ec70ee9b2de7f800e206a18510"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8701fda1fa31b25abbc9c0df42da10e8"></a><!-- doxytag: member="TiXmlDocument::Print" ref="a8701fda1fa31b25abbc9c0df42da10e8" args="(FILE *cfile, int depth=0) const " -->
virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a8701fda1fa31b25abbc9c0df42da10e8">Print</a> (FILE *cfile, int depth=0) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Print this Document to a FILE stream. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1dc977bde3e4fe85a8eb9d88a35ef5a4"></a><!-- doxytag: member="TiXmlDocument::ToDocument" ref="a1dc977bde3e4fe85a8eb9d88a35ef5a4" args="() const " -->
virtual const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a1dc977bde3e4fe85a8eb9d88a35ef5a4">ToDocument</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1025d942a1f328fd742d545e37efdd42"></a><!-- doxytag: member="TiXmlDocument::ToDocument" ref="a1025d942a1f328fd742d545e37efdd42" args="()" -->
virtual <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a1025d942a1f328fd742d545e37efdd42">ToDocument</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa545aae325d9752ad64120bc4ecf939a"></a><!-- doxytag: member="TiXmlDocument::Accept" ref="aa545aae325d9752ad64120bc4ecf939a" args="(TiXmlVisitor *content) const " -->
virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#aa545aae325d9752ad64120bc4ecf939a">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *content) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br/></td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a4968661cab4a1f44a23329c6f8db1907">Clone</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an exact duplicate of this node and return it. <a href="#a4968661cab4a1f44a23329c6f8db1907"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Always the top level node. </p>
<p>A document binds together all the XML pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name. </p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac66b8c28db86363315712a3574e87c35"></a><!-- doxytag: member="TiXmlDocument::ClearError" ref="ac66b8c28db86363315712a3574e87c35" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TiXmlDocument::ClearError </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>If you have handled the error, it can be reset with this call. </p>
<p>The error state is automatically cleared if you Parse a new XML block. </p>
</div>
</div>
<a class="anchor" id="a4968661cab4a1f44a23329c6f8db1907"></a><!-- doxytag: member="TiXmlDocument::Clone" ref="a4968661cab4a1f44a23329c6f8db1907" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlDocument::Clone </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create an exact duplicate of this node and return it. </p>
<p>The memory must be deleted by the caller. </p>
<p>Implements <a class="el" href="classTiXmlNode.html#a4508cc3a2d7a98e96a54cc09c37a78a4">TiXmlNode</a>.</p>
</div>
</div>
<a class="anchor" id="a6dfc01a6e5d58e56acd537dfd3bdeb29"></a><!-- doxytag: member="TiXmlDocument::Error" ref="a6dfc01a6e5d58e56acd537dfd3bdeb29" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool TiXmlDocument::Error </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>If an error occurs, Error will be set to true. </p>
<p>Also,</p>
<ul>
<li>The <a class="el" href="classTiXmlDocument.html#af96fc2f3f9ec6422782bfe916c9e778f" title="Generally, you probably want the error string ( ErrorDesc() ).">ErrorId()</a> will contain the integer identifier of the error (not generally useful)</li>
<li>The <a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e" title="Contains a textual (english) description of the error if one occurs.">ErrorDesc()</a> method will return the name of the error. (very useful)</li>
<li>The <a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e" title="Returns the location (if known) of the error.">ErrorRow()</a> and <a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649" title="The column where the error occured. See ErrorRow().">ErrorCol()</a> will return the location of the error (if known) </li>
</ul>
</div>
</div>
<a class="anchor" id="af96fc2f3f9ec6422782bfe916c9e778f"></a><!-- doxytag: member="TiXmlDocument::ErrorId" ref="af96fc2f3f9ec6422782bfe916c9e778f" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int TiXmlDocument::ErrorId </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Generally, you probably want the error string ( <a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e" title="Contains a textual (english) description of the error if one occurs.">ErrorDesc()</a> ). </p>
<p>But if you prefer the ErrorId, this function will fetch it. </p>
</div>
</div>
<a class="anchor" id="af30efc75e804aa2e92fb8be3a8cb676e"></a><!-- doxytag: member="TiXmlDocument::ErrorRow" ref="af30efc75e804aa2e92fb8be3a8cb676e" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int TiXmlDocument::ErrorRow </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the location (if known) of the error. </p>
<p>The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.)</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e" title="SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to...">SetTabSize</a>, <a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853" title="Return the position, in the original source file, of this node or attribute.">Row</a>, <a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003" title="See Row().">Column</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a18ae6ed34fed7991ebc220862dfac884"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a18ae6ed34fed7991ebc220862dfac884" args="(const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool TiXmlDocument::LoadFile </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">TiXmlEncoding </td>
<td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>encoding</em> </td><td>STL std::string version. </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f">LoadFile()</a>.</p>
</div>
</div>
<a class="anchor" id="a41f6fe7200864d1dca663d230caf8db6"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a41f6fe7200864d1dca663d230caf8db6" args="(FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool TiXmlDocument::LoadFile </td>
<td>(</td>
<td class="paramtype">FILE * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">TiXmlEncoding </td>
<td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Load a file using the given FILE*. </p>
<p>Returns true if successful. Note that this method doesn't stream - the entire object pointed at by the FILE* will be interpreted as an XML file. TinyXML doesn't stream in XML from the current file location. Streaming may be added in the future. </p>
</div>
</div>
<a class="anchor" id="a4c852a889c02cf251117fd1d9fe1845f"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a4c852a889c02cf251117fd1d9fe1845f" args="(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool TiXmlDocument::LoadFile </td>
<td>(</td>
<td class="paramtype">TiXmlEncoding </td>
<td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Load a file using the current document value. </p>
<p>Returns true if successful. Will delete any existing document data before loading. </p>
<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01425">LoadFile()</a>.</p>
</div>
</div>
<a class="anchor" id="a17ebabe36926ef398e78dec0d0ad0378"></a><!-- doxytag: member="TiXmlDocument::Parse" ref="a17ebabe36926ef398e78dec0d0ad0378" args="(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual const char* TiXmlDocument::Parse </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>p</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">TiXmlParsingData * </td>
<td class="paramname"> <em>data</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">TiXmlEncoding </td>
<td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Parse the given null terminated block of xml data. </p>
<p>Passing in an encoding to this method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml to use that encoding, regardless of what TinyXml might otherwise try to detect. </p>
<p>Implements <a class="el" href="classTiXmlBase.html">TiXmlBase</a>.</p>
</div>
</div>
<a class="anchor" id="af08389ec70ee9b2de7f800e206a18510"></a><!-- doxytag: member="TiXmlDocument::Print" ref="af08389ec70ee9b2de7f800e206a18510" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TiXmlDocument::Print </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Write the document to standard out using formatted printing ("pretty print"). </p>
<p>References <a class="el" href="tinyxml_8h_source.html#l01512">Print()</a>.</p>
<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01512">Print()</a>.</p>
</div>
</div>
<a class="anchor" id="ad09d17927f908f40efb406af2fb873be"></a><!-- doxytag: member="TiXmlDocument::RootElement" ref="ad09d17927f908f40efb406af2fb873be" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlDocument::RootElement </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Get the root element -- the only top level element -- of the document. </p>
<p>In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level. </p>
<p>References <a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">TiXmlNode::FirstChildElement()</a>.</p>
</div>
</div>
<a class="anchor" id="a51dac56316f89b35bdb7d0d433ba988e"></a><!-- doxytag: member="TiXmlDocument::SetTabSize" ref="a51dac56316f89b35bdb7d0d433ba988e" args="(int _tabsize)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TiXmlDocument::SetTabSize </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>_tabsize</em></td>
<td> ) </td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e" title="SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to...">SetTabSize()</a> allows the error reporting functions (<a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e" title="Returns the location (if known) of the error.">ErrorRow()</a> and <a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649" title="The column where the error occured. See ErrorRow().">ErrorCol()</a>) to report the correct values for row and column. </p>
<p>It does not change the output or input in any way.</p>
<p>By calling this method, with a tab size greater than 0, the row and column of each node and attribute is stored when the file is loaded. Very useful for tracking the DOM back in to the source file.</p>
<p>The tab size is required for calculating the location of nodes. If not set, the default of 4 is used. The tabsize is set per document. Setting the tabsize to 0 disables row/column tracking.</p>
<p>Note that row and column tracking is not supported when using operator>>.</p>
<p>The tab size needs to be enabled before the parse or load. Correct usage: </p>
<div class="fragment"><pre class="fragment">
TiXmlDocument doc;
doc.SetTabSize( 8 );
doc.Load( "myfile.xml" );
</pre></div><dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853" title="Return the position, in the original source file, of this node or attribute.">Row</a>, <a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003" title="See Row().">Column</a> </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
</ul>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
</body>
</html>
|