classTiXmlDocument.html revision c3bbea3c3cfee4908189a57b3fc54f105b78c59b
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5<title>TinyXml: TiXmlDocument Class Reference</title>
6<link href="tabs.css" rel="stylesheet" type="text/css"/>
7<link href="doxygen.css" rel="stylesheet" type="text/css"/>
8</head>
9<body>
10<!-- Generated by Doxygen 1.6.2 -->
11<div class="navigation" id="top">
12  <div class="tabs">
13    <ul>
14      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
15      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
16      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
17      <li><a href="files.html"><span>Files</span></a></li>
18    </ul>
19  </div>
20  <div class="tabs">
21    <ul>
22      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
23      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
24      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
25    </ul>
26  </div>
27</div>
28<div class="contents">
29<h1>TiXmlDocument Class Reference</h1><!-- doxytag: class="TiXmlDocument" --><!-- doxytag: inherits="TiXmlNode" -->
30<p>Always the top level node.  
31<a href="#_details">More...</a></p>
32
33<p><code>#include &lt;<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>&gt;</code></p>
34<div class="dynheader">
35Inheritance diagram for TiXmlDocument:</div>
36<div class="dynsection">
37 <div class="center">
38  <img src="classTiXmlDocument.png" usemap="#TiXmlDocument_map" alt=""/>
39  <map id="TiXmlDocument_map" name="TiXmlDocument_map">
40<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,99,80"/>
41<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,99,24"/>
42</map>
43 </div>
44</div>
45
46<p><a href="classTiXmlDocument-members.html">List of all members.</a></p>
47<table border="0" cellpadding="0" cellspacing="0">
48<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
49<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9f5e84335708fde98400230f9f12659c"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="a9f5e84335708fde98400230f9f12659c" args="()" -->
50&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a9f5e84335708fde98400230f9f12659c">TiXmlDocument</a> ()</td></tr>
51<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create an empty document, that has no name. <br/></td></tr>
52<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae4508b452d0c3061db085f3db27b8396"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="ae4508b452d0c3061db085f3db27b8396" args="(const char *documentName)" -->
53&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ae4508b452d0c3061db085f3db27b8396">TiXmlDocument</a> (const char *documentName)</td></tr>
54<tr><td class="mdescLeft">&nbsp;</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>
55<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2c6e58fb99bfa76cc613f16840022225"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="a2c6e58fb99bfa76cc613f16840022225" args="(const std::string &amp;documentName)" -->
56&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a2c6e58fb99bfa76cc613f16840022225">TiXmlDocument</a> (const std::string &amp;documentName)</td></tr>
57<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <br/></td></tr>
58<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f">LoadFile</a> (TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
59<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Load a file using the current document value.  <a href="#a4c852a889c02cf251117fd1d9fe1845f"></a><br/></td></tr>
60<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a21c0aeb0d0a720169ad4ac89523ebe93"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="a21c0aeb0d0a720169ad4ac89523ebe93" args="() const " -->
61bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a> () const </td></tr>
62<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Save a file using the current document value. Returns true if successful. <br/></td></tr>
63<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)" -->
64bool&nbsp;</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>
65<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Load a file using the given filename. Returns true if successful. <br/></td></tr>
66<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 " -->
67bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ae869f5ebf7fc54c4a1d737fb4689fd44">SaveFile</a> (const char *filename) const </td></tr>
68<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Save a file using the given filename. Returns true if successful. <br/></td></tr>
69<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a41f6fe7200864d1dca663d230caf8db6">LoadFile</a> (FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
70<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Load a file using the given FILE*.  <a href="#a41f6fe7200864d1dca663d230caf8db6"></a><br/></td></tr>
71<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acf1672b4538c6d1d441f9f108aea2bf4"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="acf1672b4538c6d1d441f9f108aea2bf4" args="(FILE *) const " -->
72bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#acf1672b4538c6d1d441f9f108aea2bf4">SaveFile</a> (FILE *) const </td></tr>
73<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Save a file using the given FILE*. Returns true if successful. <br/></td></tr>
74<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a18ae6ed34fed7991ebc220862dfac884">LoadFile</a> (const std::string &amp;filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
75<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3d4fae0463f3f03679ba0b7cf6f2df52"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="a3d4fae0463f3f03679ba0b7cf6f2df52" args="(const std::string &amp;filename) const " -->
76bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a3d4fae0463f3f03679ba0b7cf6f2df52">SaveFile</a> (const std::string &amp;filename) const </td></tr>
77<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">&lt; STL std::string version. <br/></td></tr>
78<tr><td class="memItemLeft" align="right" valign="top">virtual const char *&nbsp;</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>
79<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Parse the given null terminated block of xml data.  <a href="#a17ebabe36926ef398e78dec0d0ad0378"></a><br/></td></tr>
80<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ad09d17927f908f40efb406af2fb873be">RootElement</a> () const </td></tr>
81<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the root element -- the only top level element -- of the document.  <a href="#ad09d17927f908f40efb406af2fb873be"></a><br/></td></tr>
82<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a6dfc01a6e5d58e56acd537dfd3bdeb29">Error</a> () const </td></tr>
83<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If an error occurs, Error will be set to true.  <a href="#a6dfc01a6e5d58e56acd537dfd3bdeb29"></a><br/></td></tr>
84<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9d0f689f6e09ea494ea547be8d79c25e"></a><!-- doxytag: member="TiXmlDocument::ErrorDesc" ref="a9d0f689f6e09ea494ea547be8d79c25e" args="() const " -->
85const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc</a> () const </td></tr>
86<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Contains a textual (english) description of the error if one occurs. <br/></td></tr>
87<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#af96fc2f3f9ec6422782bfe916c9e778f">ErrorId</a> () const </td></tr>
88<tr><td class="mdescLeft">&nbsp;</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>
89<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e">ErrorRow</a> () const </td></tr>
90<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the location (if known) of the error.  <a href="#af30efc75e804aa2e92fb8be3a8cb676e"></a><br/></td></tr>
91<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa90bc630ee5203c6109ca5fad3323649"></a><!-- doxytag: member="TiXmlDocument::ErrorCol" ref="aa90bc630ee5203c6109ca5fad3323649" args="() const " -->
92int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649">ErrorCol</a> () const </td></tr>
93<tr><td class="mdescLeft">&nbsp;</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>
94<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e">SetTabSize</a> (int _tabsize)</td></tr>
95<tr><td class="mdescLeft">&nbsp;</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>
96<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ac66b8c28db86363315712a3574e87c35">ClearError</a> ()</td></tr>
97<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If you have handled the error, it can be reset with this call.  <a href="#ac66b8c28db86363315712a3574e87c35"></a><br/></td></tr>
98<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#af08389ec70ee9b2de7f800e206a18510">Print</a> () const </td></tr>
99<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write the document to standard out using formatted printing ("pretty print").  <a href="#af08389ec70ee9b2de7f800e206a18510"></a><br/></td></tr>
100<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 " -->
101virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a8701fda1fa31b25abbc9c0df42da10e8">Print</a> (FILE *cfile, int depth=0) const </td></tr>
102<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print this Document to a FILE stream. <br/></td></tr>
103<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1dc977bde3e4fe85a8eb9d88a35ef5a4"></a><!-- doxytag: member="TiXmlDocument::ToDocument" ref="a1dc977bde3e4fe85a8eb9d88a35ef5a4" args="() const " -->
104virtual const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a1dc977bde3e4fe85a8eb9d88a35ef5a4">ToDocument</a> () const </td></tr>
105<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
106<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1025d942a1f328fd742d545e37efdd42"></a><!-- doxytag: member="TiXmlDocument::ToDocument" ref="a1025d942a1f328fd742d545e37efdd42" args="()" -->
107virtual <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a1025d942a1f328fd742d545e37efdd42">ToDocument</a> ()</td></tr>
108<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
109<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa545aae325d9752ad64120bc4ecf939a"></a><!-- doxytag: member="TiXmlDocument::Accept" ref="aa545aae325d9752ad64120bc4ecf939a" args="(TiXmlVisitor *content) const " -->
110virtual bool&nbsp;</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>
111<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br/></td></tr>
112<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
113<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a4968661cab4a1f44a23329c6f8db1907">Clone</a> () const </td></tr>
114<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create an exact duplicate of this node and return it.  <a href="#a4968661cab4a1f44a23329c6f8db1907"></a><br/></td></tr>
115</table>
116<hr/><a name="_details"></a><h2>Detailed Description</h2>
117<p>Always the top level node. </p>
118<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>
119<hr/><h2>Member Function Documentation</h2>
120<a class="anchor" id="ac66b8c28db86363315712a3574e87c35"></a><!-- doxytag: member="TiXmlDocument::ClearError" ref="ac66b8c28db86363315712a3574e87c35" args="()" -->
121<div class="memitem">
122<div class="memproto">
123      <table class="memname">
124        <tr>
125          <td class="memname">void TiXmlDocument::ClearError </td>
126          <td>(</td>
127          <td class="paramname"></td>
128          <td>&nbsp;)&nbsp;</td>
129          <td><code> [inline]</code></td>
130        </tr>
131      </table>
132</div>
133<div class="memdoc">
134
135<p>If you have handled the error, it can be reset with this call. </p>
136<p>The error state is automatically cleared if you Parse a new XML block. </p>
137
138</div>
139</div>
140<a class="anchor" id="a4968661cab4a1f44a23329c6f8db1907"></a><!-- doxytag: member="TiXmlDocument::Clone" ref="a4968661cab4a1f44a23329c6f8db1907" args="() const " -->
141<div class="memitem">
142<div class="memproto">
143      <table class="memname">
144        <tr>
145          <td class="memname">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlDocument::Clone </td>
146          <td>(</td>
147          <td class="paramname"></td>
148          <td>&nbsp;)&nbsp;</td>
149          <td> const<code> [protected, virtual]</code></td>
150        </tr>
151      </table>
152</div>
153<div class="memdoc">
154
155<p>Create an exact duplicate of this node and return it. </p>
156<p>The memory must be deleted by the caller. </p>
157
158<p>Implements <a class="el" href="classTiXmlNode.html#a4508cc3a2d7a98e96a54cc09c37a78a4">TiXmlNode</a>.</p>
159
160</div>
161</div>
162<a class="anchor" id="a6dfc01a6e5d58e56acd537dfd3bdeb29"></a><!-- doxytag: member="TiXmlDocument::Error" ref="a6dfc01a6e5d58e56acd537dfd3bdeb29" args="() const " -->
163<div class="memitem">
164<div class="memproto">
165      <table class="memname">
166        <tr>
167          <td class="memname">bool TiXmlDocument::Error </td>
168          <td>(</td>
169          <td class="paramname"></td>
170          <td>&nbsp;)&nbsp;</td>
171          <td> const<code> [inline]</code></td>
172        </tr>
173      </table>
174</div>
175<div class="memdoc">
176
177<p>If an error occurs, Error will be set to true. </p>
178<p>Also,</p>
179<ul>
180<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>
181<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>
182<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>
183</ul>
184
185</div>
186</div>
187<a class="anchor" id="af96fc2f3f9ec6422782bfe916c9e778f"></a><!-- doxytag: member="TiXmlDocument::ErrorId" ref="af96fc2f3f9ec6422782bfe916c9e778f" args="() const " -->
188<div class="memitem">
189<div class="memproto">
190      <table class="memname">
191        <tr>
192          <td class="memname">int TiXmlDocument::ErrorId </td>
193          <td>(</td>
194          <td class="paramname"></td>
195          <td>&nbsp;)&nbsp;</td>
196          <td> const<code> [inline]</code></td>
197        </tr>
198      </table>
199</div>
200<div class="memdoc">
201
202<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>
203<p>But if you prefer the ErrorId, this function will fetch it. </p>
204
205</div>
206</div>
207<a class="anchor" id="af30efc75e804aa2e92fb8be3a8cb676e"></a><!-- doxytag: member="TiXmlDocument::ErrorRow" ref="af30efc75e804aa2e92fb8be3a8cb676e" args="() const " -->
208<div class="memitem">
209<div class="memproto">
210      <table class="memname">
211        <tr>
212          <td class="memname">int TiXmlDocument::ErrorRow </td>
213          <td>(</td>
214          <td class="paramname"></td>
215          <td>&nbsp;)&nbsp;</td>
216          <td> const<code> [inline]</code></td>
217        </tr>
218      </table>
219</div>
220<div class="memdoc">
221
222<p>Returns the location (if known) of the error. </p>
223<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>
224<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>
225
226</div>
227</div>
228<a class="anchor" id="a18ae6ed34fed7991ebc220862dfac884"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a18ae6ed34fed7991ebc220862dfac884" args="(const std::string &amp;filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
229<div class="memitem">
230<div class="memproto">
231      <table class="memname">
232        <tr>
233          <td class="memname">bool TiXmlDocument::LoadFile </td>
234          <td>(</td>
235          <td class="paramtype">const std::string &amp;&nbsp;</td>
236          <td class="paramname"> <em>filename</em>, </td>
237        </tr>
238        <tr>
239          <td class="paramkey"></td>
240          <td></td>
241          <td class="paramtype">TiXmlEncoding&nbsp;</td>
242          <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td>&nbsp;</td>
243        </tr>
244        <tr>
245          <td></td>
246          <td>)</td>
247          <td></td><td></td><td><code> [inline]</code></td>
248        </tr>
249      </table>
250</div>
251<div class="memdoc">
252<dl><dt><b>Parameters:</b></dt><dd>
253  <table border="0" cellspacing="2" cellpadding="0">
254    <tr><td valign="top"></td><td valign="top"><em>encoding</em>&nbsp;</td><td>STL std::string version. </td></tr>
255  </table>
256  </dd>
257</dl>
258
259<p>References <a class="el" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f">LoadFile()</a>.</p>
260
261</div>
262</div>
263<a class="anchor" id="a41f6fe7200864d1dca663d230caf8db6"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a41f6fe7200864d1dca663d230caf8db6" args="(FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
264<div class="memitem">
265<div class="memproto">
266      <table class="memname">
267        <tr>
268          <td class="memname">bool TiXmlDocument::LoadFile </td>
269          <td>(</td>
270          <td class="paramtype">FILE *&nbsp;</td>
271          <td class="paramname">, </td>
272        </tr>
273        <tr>
274          <td class="paramkey"></td>
275          <td></td>
276          <td class="paramtype">TiXmlEncoding&nbsp;</td>
277          <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td>&nbsp;</td>
278        </tr>
279        <tr>
280          <td></td>
281          <td>)</td>
282          <td></td><td></td><td></td>
283        </tr>
284      </table>
285</div>
286<div class="memdoc">
287
288<p>Load a file using the given FILE*. </p>
289<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>
290
291</div>
292</div>
293<a class="anchor" id="a4c852a889c02cf251117fd1d9fe1845f"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a4c852a889c02cf251117fd1d9fe1845f" args="(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
294<div class="memitem">
295<div class="memproto">
296      <table class="memname">
297        <tr>
298          <td class="memname">bool TiXmlDocument::LoadFile </td>
299          <td>(</td>
300          <td class="paramtype">TiXmlEncoding&nbsp;</td>
301          <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td>
302          <td>&nbsp;)&nbsp;</td>
303          <td></td>
304        </tr>
305      </table>
306</div>
307<div class="memdoc">
308
309<p>Load a file using the current document value. </p>
310<p>Returns true if successful. Will delete any existing document data before loading. </p>
311
312<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01432">LoadFile()</a>.</p>
313
314</div>
315</div>
316<a class="anchor" id="a17ebabe36926ef398e78dec0d0ad0378"></a><!-- doxytag: member="TiXmlDocument::Parse" ref="a17ebabe36926ef398e78dec0d0ad0378" args="(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
317<div class="memitem">
318<div class="memproto">
319      <table class="memname">
320        <tr>
321          <td class="memname">virtual const char* TiXmlDocument::Parse </td>
322          <td>(</td>
323          <td class="paramtype">const char *&nbsp;</td>
324          <td class="paramname"> <em>p</em>, </td>
325        </tr>
326        <tr>
327          <td class="paramkey"></td>
328          <td></td>
329          <td class="paramtype">TiXmlParsingData *&nbsp;</td>
330          <td class="paramname"> <em>data</em> = <code>0</code>, </td>
331        </tr>
332        <tr>
333          <td class="paramkey"></td>
334          <td></td>
335          <td class="paramtype">TiXmlEncoding&nbsp;</td>
336          <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td>&nbsp;</td>
337        </tr>
338        <tr>
339          <td></td>
340          <td>)</td>
341          <td></td><td></td><td><code> [virtual]</code></td>
342        </tr>
343      </table>
344</div>
345<div class="memdoc">
346
347<p>Parse the given null terminated block of xml data. </p>
348<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>
349
350<p>Implements <a class="el" href="classTiXmlBase.html">TiXmlBase</a>.</p>
351
352</div>
353</div>
354<a class="anchor" id="af08389ec70ee9b2de7f800e206a18510"></a><!-- doxytag: member="TiXmlDocument::Print" ref="af08389ec70ee9b2de7f800e206a18510" args="() const " -->
355<div class="memitem">
356<div class="memproto">
357      <table class="memname">
358        <tr>
359          <td class="memname">void TiXmlDocument::Print </td>
360          <td>(</td>
361          <td class="paramname"></td>
362          <td>&nbsp;)&nbsp;</td>
363          <td> const<code> [inline]</code></td>
364        </tr>
365      </table>
366</div>
367<div class="memdoc">
368
369<p>Write the document to standard out using formatted printing ("pretty print"). </p>
370
371<p>References <a class="el" href="tinyxml_8h_source.html#l01519">Print()</a>.</p>
372
373<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01519">Print()</a>.</p>
374
375</div>
376</div>
377<a class="anchor" id="ad09d17927f908f40efb406af2fb873be"></a><!-- doxytag: member="TiXmlDocument::RootElement" ref="ad09d17927f908f40efb406af2fb873be" args="() const " -->
378<div class="memitem">
379<div class="memproto">
380      <table class="memname">
381        <tr>
382          <td class="memname">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlDocument::RootElement </td>
383          <td>(</td>
384          <td class="paramname"></td>
385          <td>&nbsp;)&nbsp;</td>
386          <td> const<code> [inline]</code></td>
387        </tr>
388      </table>
389</div>
390<div class="memdoc">
391
392<p>Get the root element -- the only top level element -- of the document. </p>
393<p>In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level. </p>
394
395<p>References <a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">TiXmlNode::FirstChildElement()</a>.</p>
396
397</div>
398</div>
399<a class="anchor" id="a51dac56316f89b35bdb7d0d433ba988e"></a><!-- doxytag: member="TiXmlDocument::SetTabSize" ref="a51dac56316f89b35bdb7d0d433ba988e" args="(int _tabsize)" -->
400<div class="memitem">
401<div class="memproto">
402      <table class="memname">
403        <tr>
404          <td class="memname">void TiXmlDocument::SetTabSize </td>
405          <td>(</td>
406          <td class="paramtype">int&nbsp;</td>
407          <td class="paramname"> <em>_tabsize</em></td>
408          <td>&nbsp;)&nbsp;</td>
409          <td><code> [inline]</code></td>
410        </tr>
411      </table>
412</div>
413<div class="memdoc">
414
415<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>
416<p>It does not change the output or input in any way.</p>
417<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>
418<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>
419<p>Note that row and column tracking is not supported when using operator&gt;&gt;.</p>
420<p>The tab size needs to be enabled before the parse or load. Correct usage: </p>
421<div class="fragment"><pre class="fragment">
422		TiXmlDocument doc;
423		doc.SetTabSize( 8 );
424		doc.Load( "myfile.xml" );
425		</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>
426
427</div>
428</div>
429<hr/>The documentation for this class was generated from the following file:<ul>
430<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
431</ul>
432</div>
433<hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
434<a href="http://www.doxygen.org/index.html">
435<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
436</body>
437</html>
438