📄 classtixmldocument.html
字号:
<p>Generally, you probably want the error string ( <a class="el" href="classTiXmlDocument.html#9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc()</a> ). <p>But if you prefer the ErrorId, this function will fetch it. </div></div><p><a class="anchor" name="f30efc75e804aa2e92fb8be3a8cb676e"></a><!-- doxytag: member="TiXmlDocument::ErrorRow" ref="f30efc75e804aa2e92fb8be3a8cb676e" 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 width="100%"> const<code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Returns the location (if known) of the error. <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 compact><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">SetTabSize</a>, <a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>, <a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a> </dd></dl></div></div><p><a class="anchor" name="18ae6ed34fed7991ebc220862dfac884"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="18ae6ed34fed7991ebc220862dfac884" 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 width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p><dl compact><dt><b>Parameters: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>encoding</em> </td><td>STL std::string version. </td></tr></table></dl></div></div><p><a class="anchor" name="41f6fe7200864d1dca663d230caf8db6"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="41f6fe7200864d1dca663d230caf8db6" 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 width="100%"></td> </tr> </table></div><div class="memdoc"><p>Load a file using the given FILE*. <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. </div></div><p><a class="anchor" name="4c852a889c02cf251117fd1d9fe1845f"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="4c852a889c02cf251117fd1d9fe1845f" 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 width="100%"></td> </tr> </table></div><div class="memdoc"><p>Load a file using the current document value. <p>Returns true if successful. Will delete any existing document data before loading. </div></div><p><a class="anchor" name="17ebabe36926ef398e78dec0d0ad0378"></a><!-- doxytag: member="TiXmlDocument::Parse" ref="17ebabe36926ef398e78dec0d0ad0378" 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 width="100%"><code> [virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Parse the given null terminated block of xml data. <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>Implements <a class="el" href="classTiXmlBase.html">TiXmlBase</a>.</div></div><p><a class="anchor" name="d09d17927f908f40efb406af2fb873be"></a><!-- doxytag: member="TiXmlDocument::RootElement" ref="d09d17927f908f40efb406af2fb873be" 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 width="100%"> 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>In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level. </div></div><p><a class="anchor" name="51dac56316f89b35bdb7d0d433ba988e"></a><!-- doxytag: member="TiXmlDocument::SetTabSize" ref="51dac56316f89b35bdb7d0d433ba988e" 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 width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p><a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">SetTabSize()</a> allows the error reporting functions (<a class="el" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">ErrorRow()</a> and <a class="el" href="classTiXmlDocument.html#a90bc630ee5203c6109ca5fad3323649">ErrorCol()</a>) to report the correct values for row and column. <p>It does not change the output or input in any way.<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>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>Note that row and column tracking is not supported when using operator>>.<p>The tab size needs to be enabled before the parse or load. Correct usage: <div class="fragment"><pre class="fragment"> TiXmlDocument doc; doc.SetTabSize( 8 ); doc.Load( "myfile.xml" ); </pre></div><p><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>, <a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a> </dd></dl></div></div><p><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></ul><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -