⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tinyxml_8h-source.html

📁 xml文件处理多平台类
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>tinyxml.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center><hr><h1>tinyxml.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment">www.sourceforge.net/projects/tinyxml</span>00003 <span class="comment">Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com)</span>00004 <span class="comment"></span>00005 <span class="comment">This software is provided 'as-is', without any express or implied</span>00006 <span class="comment">warranty. In no event will the authors be held liable for any</span>00007 <span class="comment">damages arising from the use of this software.</span>00008 <span class="comment"></span>00009 <span class="comment">Permission is granted to anyone to use this software for any</span>00010 <span class="comment">purpose, including commercial applications, and to alter it and</span>00011 <span class="comment">redistribute it freely, subject to the following restrictions:</span>00012 <span class="comment"></span>00013 <span class="comment">1. The origin of this software must not be misrepresented; you must</span>00014 <span class="comment">not claim that you wrote the original software. If you use this</span>00015 <span class="comment">software in a product, an acknowledgment in the product documentation</span>00016 <span class="comment">would be appreciated but is not required.</span>00017 <span class="comment"></span>00018 <span class="comment">2. Altered source versions must be plainly marked as such, and</span>00019 <span class="comment">must not be misrepresented as being the original software.</span>00020 <span class="comment"></span>00021 <span class="comment">3. This notice may not be removed or altered from any source</span>00022 <span class="comment">distribution.</span>00023 <span class="comment">*/</span>00024 00025 00026 <span class="preprocessor">#ifndef TINYXML_INCLUDED</span>00027 <span class="preprocessor"></span><span class="preprocessor">#define TINYXML_INCLUDED</span>00028 <span class="preprocessor"></span>00029 <span class="preprocessor">#ifdef _MSC_VER</span>00030 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4530 )</span>00031 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4786 )</span>00032 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00033 <span class="preprocessor"></span>00034 <span class="preprocessor">#include &lt;ctype.h&gt;</span>00035 <span class="preprocessor">#include &lt;stdio.h&gt;</span>00036 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>00037 <span class="preprocessor">#include &lt;string.h&gt;</span>00038 <span class="preprocessor">#include &lt;assert.h&gt;</span>00039 00040 <span class="comment">// Help out windows:</span>00041 <span class="preprocessor">#if defined( _DEBUG ) &amp;&amp; !defined( DEBUG )</span>00042 <span class="preprocessor"></span><span class="preprocessor">#define DEBUG</span>00043 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00044 <span class="preprocessor"></span>00045 <span class="preprocessor">#if defined( DEBUG ) &amp;&amp; defined( _MSC_VER )</span>00046 <span class="preprocessor"></span><span class="preprocessor">#include &lt;windows.h&gt;</span>00047 <span class="preprocessor">#define TIXML_LOG OutputDebugString</span>00048 <span class="preprocessor"></span><span class="preprocessor">#else</span>00049 <span class="preprocessor"></span><span class="preprocessor">#define TIXML_LOG printf</span>00050 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00051 <span class="preprocessor"></span>00052 <span class="preprocessor">#ifdef TIXML_USE_STL</span>00053 <span class="preprocessor"></span><span class="preprocessor">    #include &lt;string&gt;</span>00054 <span class="preprocessor">    #include &lt;iostream&gt;</span>00055 <span class="preprocessor">    #define TIXML_STRING    std::string</span>00056 <span class="preprocessor"></span><span class="preprocessor">    #define TIXML_ISTREAM   std::istream</span>00057 <span class="preprocessor"></span><span class="preprocessor">    #define TIXML_OSTREAM   std::ostream</span>00058 <span class="preprocessor"></span><span class="preprocessor">#else</span>00059 <span class="preprocessor"></span><span class="preprocessor">    #include "tinystr.h"</span>00060 <span class="preprocessor">    #define TIXML_STRING    TiXmlString</span>00061 <span class="preprocessor"></span><span class="preprocessor">    #define TIXML_OSTREAM   TiXmlOutStream</span>00062 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00063 <span class="preprocessor"></span>00064 <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>;00065 <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a>;00066 <span class="keyword">class </span><a class="code" href="classTiXmlComment.html">TiXmlComment</a>;00067 <span class="keyword">class </span><a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>;00068 <span class="keyword">class </span><a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>;00069 <span class="keyword">class </span><a class="code" href="classTiXmlText.html">TiXmlText</a>;00070 <span class="keyword">class </span><a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>;00071 <span class="keyword">class </span>TiXmlParsingData;00072 00073 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_MAJOR_VERSION = 2;00074 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_MINOR_VERSION = 3;00075 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_PATCH_VERSION = 2;00076 00077 <span class="comment">/*  Internal structure for tracking location of items </span>00078 <span class="comment">    in the XML file.</span>00079 <span class="comment">*/</span>00080 <span class="keyword">struct </span>TiXmlCursor00081 {00082     TiXmlCursor()       { Clear(); }00083     <span class="keywordtype">void</span> Clear()        { row = col = -1; }00084 00085     <span class="keywordtype">int</span> row;    <span class="comment">// 0 based.</span>00086     <span class="keywordtype">int</span> col;    <span class="comment">// 0 based.</span>00087 };00088 00089 00090 <span class="comment">// Only used by Attribute::Query functions</span>00091 <span class="keyword">enum</span> 00092 { 00093     TIXML_SUCCESS,00094     TIXML_NO_ATTRIBUTE,00095     TIXML_WRONG_TYPE00096 };00097 00098 00099 <span class="comment">// Used by the parsing routines.</span>00100 <span class="keyword">enum</span> TiXmlEncoding00101 {00102     TIXML_ENCODING_UNKNOWN,00103     TIXML_ENCODING_UTF8,00104     TIXML_ENCODING_LEGACY00105 };00106 00107 <span class="keyword">const</span> TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN;00108 <a name="l00131"></a><a class="code" href="classTiXmlBase.html">00131</a> <span class="keyword">class </span><a class="code" href="classTiXmlBase.html">TiXmlBase</a>00132 {00133     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlNode.html">TiXmlNode</a>;00134     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a>;00135     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>;00136 00137 <span class="keyword">public</span>:00138     <a class="code" href="classTiXmlBase.html">TiXmlBase</a>() :   <a class="code" href="classTiXmlBase.html#n1">userData</a>(0) {}00139     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlBase.html">TiXmlBase</a>()                    {}00140 00146     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlBase.html#a2">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span> = 0;00147 <a name="l00154"></a><a class="code" href="classTiXmlBase.html#d0">00154</a>     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlBase.html#d0">SetCondenseWhiteSpace</a>( <span class="keywordtype">bool</span> condense )      { condenseWhiteSpace = condense; }00155 <a name="l00157"></a><a class="code" href="classTiXmlBase.html#d1">00157</a>     <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlBase.html#d1">IsWhiteSpaceCondensed</a>()                     { <span class="keywordflow">return</span> condenseWhiteSpace; }00158 <a name="l00177"></a><a class="code" href="classTiXmlBase.html#a3">00177</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlBase.html#a3">Row</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> location.row + 1; }<a name="l00178"></a><a class="code" href="classTiXmlBase.html#a4">00178</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlBase.html#a4">Column</a>()<span class="keyword"> const      </span>{ <span class="keywordflow">return</span> location.col + 1; }    00179 00180     <span class="keywordtype">void</span>  SetUserData( <span class="keywordtype">void</span>* user )         { <a class="code" href="classTiXmlBase.html#n1">userData</a> = user; }00181     <span class="keywordtype">void</span>* GetUserData()                     { <span class="keywordflow">return</span> <a class="code" href="classTiXmlBase.html#n1">userData</a>; }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -