• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3<title>TinyXml: tinyxml.h Source File</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5</head><body>
6<!-- Generated by Doxygen 1.4.4 -->
7<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a></div>
8<h1>tinyxml.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
9<a name="l00002"></a>00002 <span class="comment">www.sourceforge.net/projects/tinyxml</span>
10<a name="l00003"></a>00003 <span class="comment">Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com)</span>
11<a name="l00004"></a>00004 <span class="comment"></span>
12<a name="l00005"></a>00005 <span class="comment">This software is provided 'as-is', without any express or implied</span>
13<a name="l00006"></a>00006 <span class="comment">warranty. In no event will the authors be held liable for any</span>
14<a name="l00007"></a>00007 <span class="comment">damages arising from the use of this software.</span>
15<a name="l00008"></a>00008 <span class="comment"></span>
16<a name="l00009"></a>00009 <span class="comment">Permission is granted to anyone to use this software for any</span>
17<a name="l00010"></a>00010 <span class="comment">purpose, including commercial applications, and to alter it and</span>
18<a name="l00011"></a>00011 <span class="comment">redistribute it freely, subject to the following restrictions:</span>
19<a name="l00012"></a>00012 <span class="comment"></span>
20<a name="l00013"></a>00013 <span class="comment">1. The origin of this software must not be misrepresented; you must</span>
21<a name="l00014"></a>00014 <span class="comment">not claim that you wrote the original software. If you use this</span>
22<a name="l00015"></a>00015 <span class="comment">software in a product, an acknowledgment in the product documentation</span>
23<a name="l00016"></a>00016 <span class="comment">would be appreciated but is not required.</span>
24<a name="l00017"></a>00017 <span class="comment"></span>
25<a name="l00018"></a>00018 <span class="comment">2. Altered source versions must be plainly marked as such, and</span>
26<a name="l00019"></a>00019 <span class="comment">must not be misrepresented as being the original software.</span>
27<a name="l00020"></a>00020 <span class="comment"></span>
28<a name="l00021"></a>00021 <span class="comment">3. This notice may not be removed or altered from any source</span>
29<a name="l00022"></a>00022 <span class="comment">distribution.</span>
30<a name="l00023"></a>00023 <span class="comment">*/</span>
31<a name="l00024"></a>00024
32<a name="l00025"></a>00025
33<a name="l00026"></a>00026 <span class="preprocessor">#ifndef TINYXML_INCLUDED</span>
34<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define TINYXML_INCLUDED</span>
35<a name="l00028"></a>00028 <span class="preprocessor"></span>
36<a name="l00029"></a>00029 <span class="preprocessor">#ifdef _MSC_VER</span>
37<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( push )</span>
38<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4530 )</span>
39<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4786 )</span>
40<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
41<a name="l00034"></a>00034 <span class="preprocessor"></span>
42<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;ctype.h&gt;</span>
43<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
44<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
45<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;string.h&gt;</span>
46<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;assert.h&gt;</span>
47<a name="l00040"></a>00040
48<a name="l00041"></a>00041 <span class="comment">// Help out windows:</span>
49<a name="l00042"></a>00042 <span class="preprocessor">#if defined( _DEBUG ) &amp;&amp; !defined( DEBUG )</span>
50<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define DEBUG</span>
51<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
52<a name="l00045"></a>00045 <span class="preprocessor"></span>
53<a name="l00046"></a>00046 <span class="preprocessor">#if defined( DEBUG ) &amp;&amp; defined( _MSC_VER )</span>
54<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#include &lt;windows.h&gt;</span>
55<a name="l00048"></a>00048 <span class="preprocessor">#define TIXML_LOG OutputDebugString</span>
56<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#else</span>
57<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#define TIXML_LOG printf</span>
58<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
59<a name="l00052"></a>00052 <span class="preprocessor"></span>
60<a name="l00053"></a>00053 <span class="preprocessor">#ifdef TIXML_USE_STL</span>
61<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">    #include &lt;string&gt;</span>
62<a name="l00055"></a>00055 <span class="preprocessor">    #include &lt;iostream&gt;</span>
63<a name="l00056"></a>00056 <span class="preprocessor">    #define TIXML_STRING    std::string</span>
64<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">    #define TIXML_ISTREAM   std::istream</span>
65<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">    #define TIXML_OSTREAM   std::ostream</span>
66<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#else</span>
67<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">    #include "tinystr.h"</span>
68<a name="l00061"></a>00061 <span class="preprocessor">    #define TIXML_STRING    TiXmlString</span>
69<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">    #define TIXML_OSTREAM   TiXmlOutStream</span>
70<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
71<a name="l00064"></a>00064 <span class="preprocessor"></span>
72<a name="l00065"></a>00065 <span class="comment">// Deprecated library function hell. Compilers want to use the</span>
73<a name="l00066"></a>00066 <span class="comment">// new safe versions. This probably doesn't fully address the problem,</span>
74<a name="l00067"></a>00067 <span class="comment">// but it gets closer. There are too many compilers for me to fully</span>
75<a name="l00068"></a>00068 <span class="comment">// test. If you get compilation troubles, undefine TIXML_SAFE</span>
76<a name="l00069"></a>00069
77<a name="l00070"></a>00070 <span class="preprocessor">#define TIXML_SAFE      // TinyXml isn't fully buffer overrun protected, safe code. This is work in progress.</span>
78<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#ifdef TIXML_SAFE</span>
79<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">    #if defined(_MSC_VER) &amp;&amp; (_MSC_VER &gt;= 1200 )</span>
80<a name="l00073"></a>00073 <span class="preprocessor"></span>        <span class="comment">// Microsoft visual studio, version 6 and higher.</span>
81<a name="l00074"></a>00074         <span class="comment">//#pragma message( "Using _sn* functions." )</span>
82<a name="l00075"></a>00075 <span class="preprocessor">        #define TIXML_SNPRINTF _snprintf</span>
83<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">        #define TIXML_SNSCANF  _snscanf</span>
84<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">    #elif defined(__GNUC__) &amp;&amp; (__GNUC__ &gt;= 3 )</span>
85<a name="l00078"></a>00078 <span class="preprocessor"></span>        <span class="comment">// GCC version 3 and higher.s</span>
86<a name="l00079"></a>00079         <span class="comment">//#warning( "Using sn* functions." )</span>
87<a name="l00080"></a>00080 <span class="preprocessor">        #define TIXML_SNPRINTF snprintf</span>
88<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">        #define TIXML_SNSCANF  snscanf</span>
89<a name="l00082"></a>00082 <span class="preprocessor"></span><span class="preprocessor">    #endif</span>
90<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#endif  </span>
91<a name="l00084"></a>00084 <span class="preprocessor"></span>
92<a name="l00085"></a>00085 <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>;
93<a name="l00086"></a>00086 <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a>;
94<a name="l00087"></a>00087 <span class="keyword">class </span><a class="code" href="classTiXmlComment.html">TiXmlComment</a>;
95<a name="l00088"></a>00088 <span class="keyword">class </span><a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>;
96<a name="l00089"></a>00089 <span class="keyword">class </span><a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>;
97<a name="l00090"></a>00090 <span class="keyword">class </span><a class="code" href="classTiXmlText.html">TiXmlText</a>;
98<a name="l00091"></a>00091 <span class="keyword">class </span><a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>;
99<a name="l00092"></a>00092 <span class="keyword">class </span>TiXmlParsingData;
100<a name="l00093"></a>00093
101<a name="l00094"></a>00094 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_MAJOR_VERSION = 2;
102<a name="l00095"></a>00095 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_MINOR_VERSION = 4;
103<a name="l00096"></a>00096 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_PATCH_VERSION = 0;
104<a name="l00097"></a>00097
105<a name="l00098"></a>00098 <span class="comment">/*  Internal structure for tracking location of items </span>
106<a name="l00099"></a>00099 <span class="comment">    in the XML file.</span>
107<a name="l00100"></a>00100 <span class="comment">*/</span>
108<a name="l00101"></a>00101 <span class="keyword">struct </span>TiXmlCursor
109<a name="l00102"></a>00102 {
110<a name="l00103"></a>00103     TiXmlCursor()       { Clear(); }
111<a name="l00104"></a>00104     <span class="keywordtype">void</span> Clear()        { row = col = -1; }
112<a name="l00105"></a>00105
113<a name="l00106"></a>00106     <span class="keywordtype">int</span> row;    <span class="comment">// 0 based.</span>
114<a name="l00107"></a>00107     <span class="keywordtype">int</span> col;    <span class="comment">// 0 based.</span>
115<a name="l00108"></a>00108 };
116<a name="l00109"></a>00109
117<a name="l00110"></a>00110
118<a name="l00111"></a>00111 <span class="comment">// Only used by Attribute::Query functions</span>
119<a name="l00112"></a>00112 <span class="keyword">enum</span>
120<a name="l00113"></a>00113 {
121<a name="l00114"></a>00114     TIXML_SUCCESS,
122<a name="l00115"></a>00115     TIXML_NO_ATTRIBUTE,
123<a name="l00116"></a>00116     TIXML_WRONG_TYPE
124<a name="l00117"></a>00117 };
125<a name="l00118"></a>00118
126<a name="l00119"></a>00119
127<a name="l00120"></a>00120 <span class="comment">// Used by the parsing routines.</span>
128<a name="l00121"></a>00121 <span class="keyword">enum</span> TiXmlEncoding
129<a name="l00122"></a>00122 {
130<a name="l00123"></a>00123     TIXML_ENCODING_UNKNOWN,
131<a name="l00124"></a>00124     TIXML_ENCODING_UTF8,
132<a name="l00125"></a>00125     TIXML_ENCODING_LEGACY
133<a name="l00126"></a>00126 };
134<a name="l00127"></a>00127
135<a name="l00128"></a>00128 <span class="keyword">const</span> TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN;
136<a name="l00129"></a>00129
137<a name="l00152"></a><a class="code" href="classTiXmlBase.html">00152</a> <span class="keyword">class </span><a class="code" href="classTiXmlBase.html">TiXmlBase</a>
138<a name="l00153"></a>00153 {
139<a name="l00154"></a>00154     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlNode.html">TiXmlNode</a>;
140<a name="l00155"></a>00155     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a>;
141<a name="l00156"></a>00156     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>;
142<a name="l00157"></a>00157
143<a name="l00158"></a>00158 <span class="keyword">public</span>:
144<a name="l00159"></a>00159     <a class="code" href="classTiXmlBase.html">TiXmlBase</a>() :   <a class="code" href="classTiXmlBase.html#p1">userData</a>(0) {}
145<a name="l00160"></a>00160     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlBase.html">TiXmlBase</a>()                    {}
146<a name="l00161"></a>00161
147<a name="l00167"></a>00167     <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;
148<a name="l00168"></a>00168
149<a name="l00175"></a><a class="code" href="classTiXmlBase.html#e0">00175</a>     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlBase.html#e0">SetCondenseWhiteSpace</a>( <span class="keywordtype">bool</span> condense )      { condenseWhiteSpace = condense; }
150<a name="l00176"></a>00176
151<a name="l00178"></a><a class="code" href="classTiXmlBase.html#e1">00178</a>     <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlBase.html#e1">IsWhiteSpaceCondensed</a>()                     { <span class="keywordflow">return</span> condenseWhiteSpace; }
152<a name="l00179"></a>00179
153<a name="l00198"></a><a class="code" href="classTiXmlBase.html#a3">00198</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; }
154<a name="l00199"></a><a class="code" href="classTiXmlBase.html#a4">00199</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; }
155<a name="l00200"></a>00200
156<a name="l00201"></a>00201     <span class="keywordtype">void</span>  SetUserData( <span class="keywordtype">void</span>* user )         { <a class="code" href="classTiXmlBase.html#p1">userData</a> = user; }
157<a name="l00202"></a>00202     <span class="keywordtype">void</span>* GetUserData()                     { <span class="keywordflow">return</span> <a class="code" href="classTiXmlBase.html#p1">userData</a>; }
158<a name="l00203"></a>00203
159<a name="l00204"></a>00204     <span class="comment">// Table that returs, for a given lead byte, the total number of bytes</span>
160<a name="l00205"></a>00205     <span class="comment">// in the UTF-8 sequence.</span>
161<a name="l00206"></a>00206     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> utf8ByteTable[256];
162<a name="l00207"></a>00207
163<a name="l00208"></a>00208     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlDocument.html#a12">Parse</a>(  <span class="keyword">const</span> <span class="keywordtype">char</span>* p,
164<a name="l00209"></a>00209                                 TiXmlParsingData* data,
165<a name="l00210"></a>00210                                 TiXmlEncoding encoding <span class="comment">/*= TIXML_ENCODING_UNKNOWN */</span> ) = 0;
166<a name="l00211"></a>00211
167<a name="l00212"></a>00212     <span class="keyword">enum</span>
168<a name="l00213"></a>00213     {
169<a name="l00214"></a>00214         TIXML_NO_ERROR = 0,
170<a name="l00215"></a>00215         TIXML_ERROR,
171<a name="l00216"></a>00216         TIXML_ERROR_OPENING_FILE,
172<a name="l00217"></a>00217         TIXML_ERROR_OUT_OF_MEMORY,
173<a name="l00218"></a>00218         TIXML_ERROR_PARSING_ELEMENT,
174<a name="l00219"></a>00219         TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME,
175<a name="l00220"></a>00220         TIXML_ERROR_READING_ELEMENT_VALUE,
176<a name="l00221"></a>00221         TIXML_ERROR_READING_ATTRIBUTES,
177<a name="l00222"></a>00222         TIXML_ERROR_PARSING_EMPTY,
178<a name="l00223"></a>00223         TIXML_ERROR_READING_END_TAG,
179<a name="l00224"></a>00224         TIXML_ERROR_PARSING_UNKNOWN,
180<a name="l00225"></a>00225         TIXML_ERROR_PARSING_COMMENT,
181<a name="l00226"></a>00226         TIXML_ERROR_PARSING_DECLARATION,
182<a name="l00227"></a>00227         TIXML_ERROR_DOCUMENT_EMPTY,
183<a name="l00228"></a>00228         TIXML_ERROR_EMBEDDED_NULL,
184<a name="l00229"></a>00229         TIXML_ERROR_PARSING_CDATA,
185<a name="l00230"></a>00230
186<a name="l00231"></a>00231         TIXML_ERROR_STRING_COUNT
187<a name="l00232"></a>00232     };
188<a name="l00233"></a>00233
189<a name="l00234"></a>00234 <span class="keyword">protected</span>:
190<a name="l00235"></a>00235
191<a name="l00236"></a>00236     <span class="comment">// See STL_STRING_BUG</span>
192<a name="l00237"></a>00237     <span class="comment">// Utility class to overcome a bug.</span>
193<a name="l00238"></a>00238     <span class="keyword">class </span>StringToBuffer
194<a name="l00239"></a>00239     {
195<a name="l00240"></a>00240       <span class="keyword">public</span>:
196<a name="l00241"></a>00241         StringToBuffer( <span class="keyword">const</span> TIXML_STRING&amp; str );
197<a name="l00242"></a>00242         ~StringToBuffer();
198<a name="l00243"></a>00243         <span class="keywordtype">char</span>* buffer;
199<a name="l00244"></a>00244     };
200<a name="l00245"></a>00245
201<a name="l00246"></a>00246     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*  SkipWhiteSpace( <span class="keyword">const</span> <span class="keywordtype">char</span>*, TiXmlEncoding encoding );
202<a name="l00247"></a>00247     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span>  IsWhiteSpace( <span class="keywordtype">char</span> c )
203<a name="l00248"></a>00248     {
204<a name="l00249"></a>00249         <span class="keywordflow">return</span> ( isspace( (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>) c ) || c == <span class="charliteral">'\n'</span> || c == <span class="charliteral">'\r'</span> );
205<a name="l00250"></a>00250     }
206<a name="l00251"></a>00251
207<a name="l00252"></a>00252     <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamOut (TIXML_OSTREAM *) <span class="keyword">const </span>= 0;
208<a name="l00253"></a>00253
209<a name="l00254"></a>00254 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
210<a name="l00255"></a>00255 <span class="preprocessor"></span>        <span class="keyword">static</span> <span class="keywordtype">bool</span> StreamWhiteSpace( TIXML_ISTREAM * in, TIXML_STRING * tag );
211<a name="l00256"></a>00256         <span class="keyword">static</span> <span class="keywordtype">bool</span> StreamTo( TIXML_ISTREAM * in, <span class="keywordtype">int</span> character, TIXML_STRING * tag );
212<a name="l00257"></a>00257 <span class="preprocessor">    #endif</span>
213<a name="l00258"></a>00258 <span class="preprocessor"></span>
214<a name="l00259"></a>00259     <span class="comment">/*  Reads an XML name into the string provided. Returns</span>
215<a name="l00260"></a>00260 <span class="comment">        a pointer just past the last character of the name,</span>
216<a name="l00261"></a>00261 <span class="comment">        or 0 if the function has an error.</span>
217<a name="l00262"></a>00262 <span class="comment">    */</span>
218<a name="l00263"></a>00263     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* ReadName( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TIXML_STRING* name, TiXmlEncoding encoding );
219<a name="l00264"></a>00264
220<a name="l00265"></a>00265     <span class="comment">/*  Reads text. Returns a pointer past the given end tag.</span>
221<a name="l00266"></a>00266 <span class="comment">        Wickedly complex options, but it keeps the (sensitive) code in one place.</span>
222<a name="l00267"></a>00267 <span class="comment">    */</span>
223<a name="l00268"></a>00268     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* ReadText(    <span class="keyword">const</span> <span class="keywordtype">char</span>* in,             <span class="comment">// where to start</span>
224<a name="l00269"></a>00269                                     TIXML_STRING* text,         <span class="comment">// the string read</span>
225<a name="l00270"></a>00270                                     <span class="keywordtype">bool</span> ignoreWhiteSpace,      <span class="comment">// whether to keep the white space</span>
226<a name="l00271"></a>00271                                     <span class="keyword">const</span> <span class="keywordtype">char</span>* endTag,         <span class="comment">// what ends this text</span>
227<a name="l00272"></a>00272                                     <span class="keywordtype">bool</span> ignoreCase,            <span class="comment">// whether to ignore case in the end tag</span>
228<a name="l00273"></a>00273                                     TiXmlEncoding encoding );   <span class="comment">// the current encoding</span>
229<a name="l00274"></a>00274
230<a name="l00275"></a>00275     <span class="comment">// If an entity has been found, transform it into a character.</span>
231<a name="l00276"></a>00276     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GetEntity( <span class="keyword">const</span> <span class="keywordtype">char</span>* in, <span class="keywordtype">char</span>* value, <span class="keywordtype">int</span>* length, TiXmlEncoding encoding );
232<a name="l00277"></a>00277
233<a name="l00278"></a>00278     <span class="comment">// Get a character, while interpreting entities.</span>
234<a name="l00279"></a>00279     <span class="comment">// The length can be from 0 to 4 bytes.</span>
235<a name="l00280"></a>00280     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GetChar( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, <span class="keywordtype">char</span>* _value, <span class="keywordtype">int</span>* length, TiXmlEncoding encoding )
236<a name="l00281"></a>00281     {
237<a name="l00282"></a>00282         assert( p );
238<a name="l00283"></a>00283         <span class="keywordflow">if</span> ( encoding == TIXML_ENCODING_UTF8 )
239<a name="l00284"></a>00284         {
240<a name="l00285"></a>00285             *length = utf8ByteTable[ *((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)p) ];
241<a name="l00286"></a>00286             assert( *length &gt;= 0 &amp;&amp; *length &lt; 5 );
242<a name="l00287"></a>00287         }
243<a name="l00288"></a>00288         <span class="keywordflow">else</span>
244<a name="l00289"></a>00289         {
245<a name="l00290"></a>00290             *length = 1;
246<a name="l00291"></a>00291         }
247<a name="l00292"></a>00292
248<a name="l00293"></a>00293         <span class="keywordflow">if</span> ( *length == 1 )
249<a name="l00294"></a>00294         {
250<a name="l00295"></a>00295             <span class="keywordflow">if</span> ( *p == <span class="charliteral">'&amp;'</span> )
251<a name="l00296"></a>00296                 <span class="keywordflow">return</span> GetEntity( p, _value, length, encoding );
252<a name="l00297"></a>00297             *_value = *p;
253<a name="l00298"></a>00298             <span class="keywordflow">return</span> p+1;
254<a name="l00299"></a>00299         }
255<a name="l00300"></a>00300         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( *length )
256<a name="l00301"></a>00301         {
257<a name="l00302"></a>00302             <span class="comment">//strncpy( _value, p, *length );    // lots of compilers don't like this function (unsafe),</span>
258<a name="l00303"></a>00303                                                 <span class="comment">// and the null terminator isn't needed</span>
259<a name="l00304"></a>00304             <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; p[i] &amp;&amp; i&lt;*length; ++i ) {
260<a name="l00305"></a>00305                 _value[i] = p[i];
261<a name="l00306"></a>00306             }
262<a name="l00307"></a>00307             <span class="keywordflow">return</span> p + (*length);
263<a name="l00308"></a>00308         }
264<a name="l00309"></a>00309         <span class="keywordflow">else</span>
265<a name="l00310"></a>00310         {
266<a name="l00311"></a>00311             <span class="comment">// Not valid text.</span>
267<a name="l00312"></a>00312             <span class="keywordflow">return</span> 0;
268<a name="l00313"></a>00313         }
269<a name="l00314"></a>00314     }
270<a name="l00315"></a>00315
271<a name="l00316"></a>00316     <span class="comment">// Puts a string to a stream, expanding entities as it goes.</span>
272<a name="l00317"></a>00317     <span class="comment">// Note this should not contian the '&lt;', '&gt;', etc, or they will be transformed into entities!</span>
273<a name="l00318"></a>00318     <span class="keyword">static</span> <span class="keywordtype">void</span> PutString( <span class="keyword">const</span> TIXML_STRING&amp; str, TIXML_OSTREAM* out );
274<a name="l00319"></a>00319
275<a name="l00320"></a>00320     <span class="keyword">static</span> <span class="keywordtype">void</span> PutString( <span class="keyword">const</span> TIXML_STRING&amp; str, TIXML_STRING* out );
276<a name="l00321"></a>00321
277<a name="l00322"></a>00322     <span class="comment">// Return true if the next characters in the stream are any of the endTag sequences.</span>
278<a name="l00323"></a>00323     <span class="comment">// Ignore case only works for english, and should only be relied on when comparing</span>
279<a name="l00324"></a>00324     <span class="comment">// to English words: StringEqual( p, "version", true ) is fine.</span>
280<a name="l00325"></a>00325     <span class="keyword">static</span> <span class="keywordtype">bool</span> StringEqual(    <span class="keyword">const</span> <span class="keywordtype">char</span>* p,
281<a name="l00326"></a>00326                                 <span class="keyword">const</span> <span class="keywordtype">char</span>* endTag,
282<a name="l00327"></a>00327                                 <span class="keywordtype">bool</span> ignoreCase,
283<a name="l00328"></a>00328                                 TiXmlEncoding encoding );
284<a name="l00329"></a>00329
285<a name="l00330"></a>00330     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* errorString[ TIXML_ERROR_STRING_COUNT ];
286<a name="l00331"></a>00331
287<a name="l00332"></a>00332     TiXmlCursor location;
288<a name="l00333"></a>00333
289<a name="l00335"></a><a class="code" href="classTiXmlBase.html#p1">00335</a>     <span class="keywordtype">void</span>*           <a class="code" href="classTiXmlBase.html#p1">userData</a>;
290<a name="l00336"></a>00336
291<a name="l00337"></a>00337     <span class="comment">// None of these methods are reliable for any language except English.</span>
292<a name="l00338"></a>00338     <span class="comment">// Good for approximation, not great for accuracy.</span>
293<a name="l00339"></a>00339     <span class="keyword">static</span> <span class="keywordtype">int</span> IsAlpha( <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> anyByte, TiXmlEncoding encoding );
294<a name="l00340"></a>00340     <span class="keyword">static</span> <span class="keywordtype">int</span> IsAlphaNum( <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> anyByte, TiXmlEncoding encoding );
295<a name="l00341"></a>00341     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">int</span> ToLower( <span class="keywordtype">int</span> v, TiXmlEncoding encoding )
296<a name="l00342"></a>00342     {
297<a name="l00343"></a>00343         <span class="keywordflow">if</span> ( encoding == TIXML_ENCODING_UTF8 )
298<a name="l00344"></a>00344         {
299<a name="l00345"></a>00345             <span class="keywordflow">if</span> ( v &lt; 128 ) <span class="keywordflow">return</span> tolower( v );
300<a name="l00346"></a>00346             <span class="keywordflow">return</span> v;
301<a name="l00347"></a>00347         }
302<a name="l00348"></a>00348         <span class="keywordflow">else</span>
303<a name="l00349"></a>00349         {
304<a name="l00350"></a>00350             <span class="keywordflow">return</span> tolower( v );
305<a name="l00351"></a>00351         }
306<a name="l00352"></a>00352     }
307<a name="l00353"></a>00353     <span class="keyword">static</span> <span class="keywordtype">void</span> ConvertUTF32ToUTF8( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> input, <span class="keywordtype">char</span>* output, <span class="keywordtype">int</span>* length );
308<a name="l00354"></a>00354
309<a name="l00355"></a>00355 <span class="keyword">private</span>:
310<a name="l00356"></a>00356     <a class="code" href="classTiXmlBase.html">TiXmlBase</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlBase.html">TiXmlBase</a>&amp; );              <span class="comment">// not implemented.</span>
311<a name="l00357"></a>00357     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlBase.html">TiXmlBase</a>&amp; base );    <span class="comment">// not allowed.</span>
312<a name="l00358"></a>00358
313<a name="l00359"></a>00359     <span class="keyword">struct </span>Entity
314<a name="l00360"></a>00360     {
315<a name="l00361"></a>00361         <span class="keyword">const</span> <span class="keywordtype">char</span>*     str;
316<a name="l00362"></a>00362         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    strLength;
317<a name="l00363"></a>00363         <span class="keywordtype">char</span>            chr;
318<a name="l00364"></a>00364     };
319<a name="l00365"></a>00365     <span class="keyword">enum</span>
320<a name="l00366"></a>00366     {
321<a name="l00367"></a>00367         NUM_ENTITY = 5,
322<a name="l00368"></a>00368         MAX_ENTITY_LENGTH = 6
323<a name="l00369"></a>00369
324<a name="l00370"></a>00370     };
325<a name="l00371"></a>00371     <span class="keyword">static</span> Entity entity[ NUM_ENTITY ];
326<a name="l00372"></a>00372     <span class="keyword">static</span> <span class="keywordtype">bool</span> condenseWhiteSpace;
327<a name="l00373"></a>00373 };
328<a name="l00374"></a>00374
329<a name="l00375"></a>00375
330<a name="l00382"></a><a class="code" href="classTiXmlNode.html">00382</a> <span class="keyword">class </span><a class="code" href="classTiXmlNode.html">TiXmlNode</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlBase.html">TiXmlBase</a>
331<a name="l00383"></a>00383 {
332<a name="l00384"></a>00384     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>;
333<a name="l00385"></a>00385     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a>;
334<a name="l00386"></a>00386
335<a name="l00387"></a>00387 <span class="keyword">public</span>:
336<a name="l00388"></a>00388 <span class="preprocessor">    #ifdef TIXML_USE_STL    </span>
337<a name="l00389"></a>00389 <span class="preprocessor"></span>
338<a name="l00393"></a>00393         <span class="keyword">friend</span> std::istream&amp; <a class="code" href="classTiXmlNode.html#n2">operator &gt;&gt; </a>(std::istream&amp; in, <a class="code" href="classTiXmlNode.html">TiXmlNode</a>&amp; base);
339<a name="l00394"></a>00394
340<a name="l00411"></a>00411         <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classTiXmlNode.html#n3">operator&lt;&lt; </a>(std::ostream&amp; out, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>&amp; base);
341<a name="l00412"></a>00412
342<a name="l00414"></a>00414         <span class="keyword">friend</span> std::string&amp; <a class="code" href="classTiXmlNode.html#n3">operator&lt;&lt; </a>(std::string&amp; out, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>&amp; base );
343<a name="l00415"></a>00415
344<a name="l00416"></a>00416 <span class="preprocessor">    #else</span>
345<a name="l00417"></a>00417 <span class="preprocessor"></span>        <span class="comment">// Used internally, not part of the public API.</span>
346<a name="l00418"></a>00418         <span class="keyword">friend</span> TIXML_OSTREAM&amp; <a class="code" href="classTiXmlNode.html#n3">operator&lt;&lt; </a>(TIXML_OSTREAM&amp; out, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>&amp; base);
347<a name="l00419"></a>00419 <span class="preprocessor">    #endif</span>
348<a name="l00420"></a>00420 <span class="preprocessor"></span>
349<a name="l00424"></a><a class="code" href="classTiXmlNode.html#w7">00424</a>     <span class="keyword">enum</span> <a class="code" href="classTiXmlNode.html#w7">NodeType</a>
350<a name="l00425"></a>00425     {
351<a name="l00426"></a>00426         DOCUMENT,
352<a name="l00427"></a>00427         ELEMENT,
353<a name="l00428"></a>00428         COMMENT,
354<a name="l00429"></a>00429         UNKNOWN,
355<a name="l00430"></a>00430         TEXT,
356<a name="l00431"></a>00431         DECLARATION,
357<a name="l00432"></a>00432         TYPECOUNT
358<a name="l00433"></a>00433     };
359<a name="l00434"></a>00434
360<a name="l00435"></a>00435     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlNode.html">TiXmlNode</a>();
361<a name="l00436"></a>00436
362<a name="l00449"></a><a class="code" href="classTiXmlNode.html#a1">00449</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlNode.html#a1">Value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value.c_str (); }
363<a name="l00450"></a>00450
364<a name="l00451"></a>00451 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
365<a name="l00452"></a>00452 <span class="preprocessor"></span>
366<a name="l00456"></a><a class="code" href="classTiXmlNode.html#a2">00456</a>     <span class="keyword">const</span> std::string&amp; <a class="code" href="classTiXmlNode.html#a2">ValueStr</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value; }
367<a name="l00457"></a>00457 <span class="preprocessor">    #endif</span>
368<a name="l00458"></a>00458 <span class="preprocessor"></span>
369<a name="l00468"></a><a class="code" href="classTiXmlNode.html#a3">00468</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlNode.html#a3">SetValue</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * _value) { value = _value;}
370<a name="l00469"></a>00469
371<a name="l00470"></a>00470 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
372<a name="l00471"></a>00471 <span class="preprocessor"></span>
373<a name="l00472"></a><a class="code" href="classTiXmlNode.html#a4">00472</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlNode.html#a3">SetValue</a>( <span class="keyword">const</span> std::string&amp; _value )
374<a name="l00473"></a>00473     {
375<a name="l00474"></a>00474         StringToBuffer buf( _value );
376<a name="l00475"></a>00475         <a class="code" href="classTiXmlNode.html#a3">SetValue</a>( buf.buffer ? buf.buffer : <span class="stringliteral">""</span> );
377<a name="l00476"></a>00476     }
378<a name="l00477"></a>00477 <span class="preprocessor">    #endif</span>
379<a name="l00478"></a>00478 <span class="preprocessor"></span>
380<a name="l00480"></a>00480     <span class="keywordtype">void</span> <a class="code" href="classTiXmlNode.html#a5">Clear</a>();
381<a name="l00481"></a>00481
382<a name="l00483"></a><a class="code" href="classTiXmlNode.html#a6">00483</a>     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a6">Parent</a>()                         { <span class="keywordflow">return</span> parent; }
383<a name="l00484"></a>00484     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a6">Parent</a>()<span class="keyword"> const             </span>{ <span class="keywordflow">return</span> parent; }
384<a name="l00485"></a>00485
385<a name="l00486"></a><a class="code" href="classTiXmlNode.html#a8">00486</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a8">FirstChild</a>()<span class="keyword">   const   </span>{ <span class="keywordflow">return</span> firstChild; }
386<a name="l00487"></a>00487     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a8">FirstChild</a>()                 { <span class="keywordflow">return</span> firstChild; }
387<a name="l00488"></a>00488     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a8">FirstChild</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>;
388<a name="l00489"></a>00489     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a8">FirstChild</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value );
389<a name="l00490"></a>00490
390<a name="l00491"></a>00491     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild()<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> lastChild; }
391<a name="l00492"></a><a class="code" href="classTiXmlNode.html#a13">00492</a>     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild()  { <span class="keywordflow">return</span> lastChild; }
392<a name="l00493"></a>00493     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>;
393<a name="l00494"></a>00494     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild( <span class="keyword">const</span> <span class="keywordtype">char</span> * value );
394<a name="l00495"></a>00495
395<a name="l00496"></a>00496 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
396<a name="l00497"></a><a class="code" href="classTiXmlNode.html#a16">00497</a> <span class="preprocessor"></span>    <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a8">FirstChild</a>( <span class="keyword">const</span> std::string&amp; _value )<span class="keyword"> const  </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a8">FirstChild</a> (_value.c_str ());    }
397<a name="l00498"></a><a class="code" href="classTiXmlNode.html#a17">00498</a>     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a8">FirstChild</a>( <span class="keyword">const</span> std::string&amp; _value )              {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a8">FirstChild</a> (_value.c_str ());    }
398<a name="l00499"></a><a class="code" href="classTiXmlNode.html#a18">00499</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild( <span class="keyword">const</span> std::string&amp; _value )<span class="keyword"> const   </span>{   <span class="keywordflow">return</span> LastChild (_value.c_str ()); }
399<a name="l00500"></a><a class="code" href="classTiXmlNode.html#a19">00500</a>     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild( <span class="keyword">const</span> std::string&amp; _value )               {   <span class="keywordflow">return</span> LastChild (_value.c_str ()); }
400<a name="l00501"></a>00501 <span class="preprocessor">    #endif</span>
401<a name="l00502"></a>00502 <span class="preprocessor"></span>
402<a name="l00519"></a>00519     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a20">IterateChildren</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous ) <span class="keyword">const</span>;
403<a name="l00520"></a>00520     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a20">IterateChildren</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous );
404<a name="l00521"></a>00521
405<a name="l00523"></a>00523     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a20">IterateChildren</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous ) <span class="keyword">const</span>;
406<a name="l00524"></a>00524     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a20">IterateChildren</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value, <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous );
407<a name="l00525"></a>00525
408<a name="l00526"></a>00526 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
409<a name="l00527"></a><a class="code" href="classTiXmlNode.html#a24">00527</a> <span class="preprocessor"></span>    <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a20">IterateChildren</a>( <span class="keyword">const</span> std::string&amp; _value, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous )<span class="keyword"> const  </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a20">IterateChildren</a> (_value.c_str (), previous); }
410<a name="l00528"></a><a class="code" href="classTiXmlNode.html#a25">00528</a>     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a20">IterateChildren</a>( <span class="keyword">const</span> std::string&amp; _value, <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous ) {  <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a20">IterateChildren</a> (_value.c_str (), previous); }
411<a name="l00529"></a>00529 <span class="preprocessor">    #endif</span>
412<a name="l00530"></a>00530 <span class="preprocessor"></span>
413<a name="l00534"></a>00534     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a26">InsertEndChild</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>&amp; addThis );
414<a name="l00535"></a>00535
415<a name="l00536"></a>00536
416<a name="l00546"></a>00546     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a27">LinkEndChild</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* addThis );
417<a name="l00547"></a>00547
418<a name="l00551"></a>00551     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a28">InsertBeforeChild</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* beforeThis, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>&amp; addThis );
419<a name="l00552"></a>00552
420<a name="l00556"></a>00556     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a29">InsertAfterChild</a>(  <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* afterThis, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>&amp; addThis );
421<a name="l00557"></a>00557
422<a name="l00561"></a>00561     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a30">ReplaceChild</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* replaceThis, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>&amp; withThis );
423<a name="l00562"></a>00562
424<a name="l00564"></a>00564     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlNode.html#a31">RemoveChild</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* removeThis );
425<a name="l00565"></a>00565
426<a name="l00567"></a><a class="code" href="classTiXmlNode.html#a32">00567</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a32">PreviousSibling</a>()<span class="keyword"> const            </span>{ <span class="keywordflow">return</span> prev; }
427<a name="l00568"></a>00568     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a32">PreviousSibling</a>()                        { <span class="keywordflow">return</span> prev; }
428<a name="l00569"></a>00569
429<a name="l00571"></a>00571     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a32">PreviousSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * ) <span class="keyword">const</span>;
430<a name="l00572"></a>00572     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a32">PreviousSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * );
431<a name="l00573"></a>00573
432<a name="l00574"></a>00574 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
433<a name="l00575"></a><a class="code" href="classTiXmlNode.html#a36">00575</a> <span class="preprocessor"></span>    <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a32">PreviousSibling</a>( <span class="keyword">const</span> std::string&amp; _value )<span class="keyword"> const </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a32">PreviousSibling</a> (_value.c_str ());   }
434<a name="l00576"></a><a class="code" href="classTiXmlNode.html#a37">00576</a>     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a32">PreviousSibling</a>( <span class="keyword">const</span> std::string&amp; _value )             {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a32">PreviousSibling</a> (_value.c_str ());   }
435<a name="l00577"></a><a class="code" href="classTiXmlNode.html#a38">00577</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a40">NextSibling</a>( <span class="keyword">const</span> std::string&amp; _value)<span class="keyword"> const      </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a40">NextSibling</a> (_value.c_str ());   }
436<a name="l00578"></a><a class="code" href="classTiXmlNode.html#a39">00578</a>     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a40">NextSibling</a>( <span class="keyword">const</span> std::string&amp; _value)                  {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a40">NextSibling</a> (_value.c_str ());   }
437<a name="l00579"></a>00579 <span class="preprocessor">    #endif</span>
438<a name="l00580"></a>00580 <span class="preprocessor"></span>
439<a name="l00582"></a><a class="code" href="classTiXmlNode.html#a40">00582</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a40">NextSibling</a>()<span class="keyword"> const                </span>{ <span class="keywordflow">return</span> next; }
440<a name="l00583"></a>00583     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a40">NextSibling</a>()                            { <span class="keywordflow">return</span> next; }
441<a name="l00584"></a>00584
442<a name="l00586"></a>00586     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a40">NextSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * ) <span class="keyword">const</span>;
443<a name="l00587"></a>00587     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a40">NextSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * );
444<a name="l00588"></a>00588
445<a name="l00593"></a>00593     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a44">NextSiblingElement</a>() <span class="keyword">const</span>;
446<a name="l00594"></a>00594     <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a44">NextSiblingElement</a>();
447<a name="l00595"></a>00595
448<a name="l00600"></a>00600     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a44">NextSiblingElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * ) <span class="keyword">const</span>;
449<a name="l00601"></a>00601     <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a44">NextSiblingElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * );
450<a name="l00602"></a>00602
451<a name="l00603"></a>00603 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
452<a name="l00604"></a><a class="code" href="classTiXmlNode.html#a48">00604</a> <span class="preprocessor"></span>    <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a44">NextSiblingElement</a>( <span class="keyword">const</span> std::string&amp; _value)<span class="keyword"> const    </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a44">NextSiblingElement</a> (_value.c_str ());    }
453<a name="l00605"></a><a class="code" href="classTiXmlNode.html#a49">00605</a>     <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a44">NextSiblingElement</a>( <span class="keyword">const</span> std::string&amp; _value)                {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a44">NextSiblingElement</a> (_value.c_str ());    }
454<a name="l00606"></a>00606 <span class="preprocessor">    #endif</span>
455<a name="l00607"></a>00607 <span class="preprocessor"></span>
456<a name="l00609"></a>00609     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a50">FirstChildElement</a>() <span class="keyword">const</span>;
457<a name="l00610"></a>00610     <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a50">FirstChildElement</a>();
458<a name="l00611"></a>00611
459<a name="l00613"></a>00613     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a50">FirstChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>;
460<a name="l00614"></a>00614     <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a50">FirstChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value );
461<a name="l00615"></a>00615
462<a name="l00616"></a>00616 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
463<a name="l00617"></a><a class="code" href="classTiXmlNode.html#a54">00617</a> <span class="preprocessor"></span>    <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a50">FirstChildElement</a>( <span class="keyword">const</span> std::string&amp; _value )<span class="keyword"> const    </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a50">FirstChildElement</a> (_value.c_str ()); }
464<a name="l00618"></a><a class="code" href="classTiXmlNode.html#a55">00618</a>     <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a50">FirstChildElement</a>( <span class="keyword">const</span> std::string&amp; _value )                {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a50">FirstChildElement</a> (_value.c_str ()); }
465<a name="l00619"></a>00619 <span class="preprocessor">    #endif</span>
466<a name="l00620"></a>00620 <span class="preprocessor"></span>
467<a name="l00625"></a><a class="code" href="classTiXmlNode.html#a56">00625</a>     <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classTiXmlNode.html#a56">Type</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span> type; }
468<a name="l00626"></a>00626
469<a name="l00630"></a>00630     <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* <a class="code" href="classTiXmlNode.html#a57">GetDocument</a>() <span class="keyword">const</span>;
470<a name="l00631"></a>00631     <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* <a class="code" href="classTiXmlNode.html#a57">GetDocument</a>();
471<a name="l00632"></a>00632
472<a name="l00634"></a><a class="code" href="classTiXmlNode.html#a59">00634</a>     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlNode.html#a59">NoChildren</a>()<span class="keyword"> const                     </span>{ <span class="keywordflow">return</span> !firstChild; }
473<a name="l00635"></a>00635
474<a name="l00636"></a><a class="code" href="classTiXmlNode.html#a60">00636</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* <a class="code" href="classTiXmlNode.html#a60">ToDocument</a>()<span class="keyword">   const       </span>{ <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == DOCUMENT ) ? (<span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>*) <span class="keyword">this</span> : 0; }
475<a name="l00637"></a><a class="code" href="classTiXmlNode.html#a61">00637</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>*  <a class="code" href="classTiXmlNode.html#a61">ToElement</a>()<span class="keyword"> const          </span>{ <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == ELEMENT  ) ? (<span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>*)  <span class="keyword">this</span> : 0; }
476<a name="l00638"></a><a class="code" href="classTiXmlNode.html#a62">00638</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>*  <a class="code" href="classTiXmlNode.html#a62">ToComment</a>()<span class="keyword"> const          </span>{ <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == COMMENT  ) ? (<span class="keyword">const</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>*)  <span class="keyword">this</span> : 0; }
477<a name="l00639"></a><a class="code" href="classTiXmlNode.html#a63">00639</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>*  <a class="code" href="classTiXmlNode.html#a63">ToUnknown</a>()<span class="keyword"> const          </span>{ <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == UNKNOWN  ) ? (<span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>*)  <span class="keyword">this</span> : 0; }
478<a name="l00640"></a><a class="code" href="classTiXmlNode.html#a64">00640</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>*       <a class="code" href="classTiXmlNode.html#a64">ToText</a>()<span class="keyword">    const        </span>{ <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == TEXT     ) ? (<span class="keyword">const</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>*)     <span class="keyword">this</span> : 0; }
479<a name="l00641"></a><a class="code" href="classTiXmlNode.html#a65">00641</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>* <a class="code" href="classTiXmlNode.html#a65">ToDeclaration</a>()<span class="keyword"> const   </span>{ <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == DECLARATION ) ? (<span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>*) <span class="keyword">this</span> : 0; }
480<a name="l00642"></a>00642
481<a name="l00643"></a><a class="code" href="classTiXmlNode.html#a66">00643</a>     <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* <a class="code" href="classTiXmlNode.html#a60">ToDocument</a>()         { <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == DOCUMENT ) ? (<a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>*) <span class="keyword">this</span> : 0; }
482<a name="l00644"></a><a class="code" href="classTiXmlNode.html#a67">00644</a>     <a class="code" href="classTiXmlElement.html">TiXmlElement</a>*  <a class="code" href="classTiXmlNode.html#a61">ToElement</a>()          { <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == ELEMENT  ) ? (<a class="code" href="classTiXmlElement.html">TiXmlElement</a>*)  <span class="keyword">this</span> : 0; }
483<a name="l00645"></a><a class="code" href="classTiXmlNode.html#a68">00645</a>     <a class="code" href="classTiXmlComment.html">TiXmlComment</a>*  <a class="code" href="classTiXmlNode.html#a62">ToComment</a>()          { <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == COMMENT  ) ? (<a class="code" href="classTiXmlComment.html">TiXmlComment</a>*)  <span class="keyword">this</span> : 0; }
484<a name="l00646"></a><a class="code" href="classTiXmlNode.html#a69">00646</a>     <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>*  <a class="code" href="classTiXmlNode.html#a63">ToUnknown</a>()          { <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == UNKNOWN  ) ? (<a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>*)  <span class="keyword">this</span> : 0; }
485<a name="l00647"></a><a class="code" href="classTiXmlNode.html#a70">00647</a>     <a class="code" href="classTiXmlText.html">TiXmlText</a>*     <a class="code" href="classTiXmlNode.html#a64">ToText</a>()             { <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == TEXT     ) ? (<a class="code" href="classTiXmlText.html">TiXmlText</a>*)     <span class="keyword">this</span> : 0; }
486<a name="l00648"></a><a class="code" href="classTiXmlNode.html#a71">00648</a>     <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>* <a class="code" href="classTiXmlNode.html#a65">ToDeclaration</a>()   { <span class="keywordflow">return</span> ( <span class="keyword">this</span> &amp;&amp; type == DECLARATION ) ? (<a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>*) <span class="keyword">this</span> : 0; }
487<a name="l00649"></a>00649
488<a name="l00653"></a>00653     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a72">Clone</a>() <span class="keyword">const </span>= 0;
489<a name="l00654"></a>00654
490<a name="l00655"></a>00655 <span class="keyword">protected</span>:
491<a name="l00656"></a>00656     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html#w7">NodeType</a> _type );
492<a name="l00657"></a>00657
493<a name="l00658"></a>00658     <span class="comment">// Copy to the allocated object. Shared functionality between Clone, Copy constructor,</span>
494<a name="l00659"></a>00659     <span class="comment">// and the assignment operator.</span>
495<a name="l00660"></a>00660     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* target ) <span class="keyword">const</span>;
496<a name="l00661"></a>00661
497<a name="l00662"></a>00662 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
498<a name="l00663"></a>00663 <span class="preprocessor"></span>        <span class="comment">// The real work of the input operator.</span>
499<a name="l00664"></a>00664         <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( TIXML_ISTREAM* in, TIXML_STRING* tag ) = 0;
500<a name="l00665"></a>00665 <span class="preprocessor">    #endif</span>
501<a name="l00666"></a>00666 <span class="preprocessor"></span>
502<a name="l00667"></a>00667     <span class="comment">// Figure out what is at *p, and parse it. Returns null if it is not an xml node.</span>
503<a name="l00668"></a>00668     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* Identify( <span class="keyword">const</span> <span class="keywordtype">char</span>* start, TiXmlEncoding encoding );
504<a name="l00669"></a>00669
505<a name="l00670"></a>00670     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>*      parent;
506<a name="l00671"></a>00671     <a class="code" href="classTiXmlNode.html#w7">NodeType</a>        type;
507<a name="l00672"></a>00672
508<a name="l00673"></a>00673     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>*      firstChild;
509<a name="l00674"></a>00674     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>*      lastChild;
510<a name="l00675"></a>00675
511<a name="l00676"></a>00676     TIXML_STRING    value;
512<a name="l00677"></a>00677
513<a name="l00678"></a>00678     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>*      prev;
514<a name="l00679"></a>00679     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>*      next;
515<a name="l00680"></a>00680
516<a name="l00681"></a>00681 <span class="keyword">private</span>:
517<a name="l00682"></a>00682     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>&amp; );              <span class="comment">// not implemented.</span>
518<a name="l00683"></a>00683     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>&amp; base );    <span class="comment">// not allowed.</span>
519<a name="l00684"></a>00684 };
520<a name="l00685"></a>00685
521<a name="l00686"></a>00686
522<a name="l00694"></a><a class="code" href="classTiXmlAttribute.html">00694</a> <span class="keyword">class </span><a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlBase.html">TiXmlBase</a>
523<a name="l00695"></a>00695 {
524<a name="l00696"></a>00696     <span class="keyword">friend</span> <span class="keyword">class </span>TiXmlAttributeSet;
525<a name="l00697"></a>00697
526<a name="l00698"></a>00698 <span class="keyword">public</span>:
527<a name="l00700"></a><a class="code" href="classTiXmlAttribute.html#a0">00700</a>     <a class="code" href="classTiXmlAttribute.html#a0">TiXmlAttribute</a>() : <a class="code" href="classTiXmlBase.html">TiXmlBase</a>()
528<a name="l00701"></a>00701     {
529<a name="l00702"></a>00702         document = 0;
530<a name="l00703"></a>00703         prev = next = 0;
531<a name="l00704"></a>00704     }
532<a name="l00705"></a>00705
533<a name="l00706"></a>00706 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
534<a name="l00707"></a>00707 <span class="preprocessor"></span>
535<a name="l00708"></a><a class="code" href="classTiXmlAttribute.html#a1">00708</a>     <a class="code" href="classTiXmlAttribute.html#a0">TiXmlAttribute</a>( <span class="keyword">const</span> std::string&amp; _name, <span class="keyword">const</span> std::string&amp; _value )
536<a name="l00709"></a>00709     {
537<a name="l00710"></a>00710         name = _name;
538<a name="l00711"></a>00711         value = _value;
539<a name="l00712"></a>00712         document = 0;
540<a name="l00713"></a>00713         prev = next = 0;
541<a name="l00714"></a>00714     }
542<a name="l00715"></a>00715 <span class="preprocessor">    #endif</span>
543<a name="l00716"></a>00716 <span class="preprocessor"></span>
544<a name="l00718"></a><a class="code" href="classTiXmlAttribute.html#a2">00718</a>     <a class="code" href="classTiXmlAttribute.html#a0">TiXmlAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _name, <span class="keyword">const</span> <span class="keywordtype">char</span> * _value )
545<a name="l00719"></a>00719     {
546<a name="l00720"></a>00720         name = _name;
547<a name="l00721"></a>00721         value = _value;
548<a name="l00722"></a>00722         document = 0;
549<a name="l00723"></a>00723         prev = next = 0;
550<a name="l00724"></a>00724     }
551<a name="l00725"></a>00725
552<a name="l00726"></a><a class="code" href="classTiXmlAttribute.html#a3">00726</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>*     <a class="code" href="classTiXmlAttribute.html#a3">Name</a>()<span class="keyword">  const       </span>{ <span class="keywordflow">return</span> name.c_str (); }
553<a name="l00727"></a><a class="code" href="classTiXmlAttribute.html#a4">00727</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>*     <a class="code" href="classTiXmlAttribute.html#a4">Value</a>()<span class="keyword"> const       </span>{ <span class="keywordflow">return</span> value.c_str (); }
554<a name="l00728"></a>00728     <span class="keywordtype">int</span>             <a class="code" href="classTiXmlAttribute.html#a5">IntValue</a>() <span class="keyword">const</span>;
555<a name="l00729"></a>00729     <span class="keywordtype">double</span>          <a class="code" href="classTiXmlAttribute.html#a6">DoubleValue</a>() <span class="keyword">const</span>;
556<a name="l00730"></a>00730
557<a name="l00740"></a>00740     <span class="keywordtype">int</span> <a class="code" href="classTiXmlAttribute.html#a7">QueryIntValue</a>( <span class="keywordtype">int</span>* _value ) <span class="keyword">const</span>;
558<a name="l00742"></a>00742     <span class="keywordtype">int</span> <a class="code" href="classTiXmlAttribute.html#a8">QueryDoubleValue</a>( <span class="keywordtype">double</span>* _value ) <span class="keyword">const</span>;
559<a name="l00743"></a>00743
560<a name="l00744"></a><a class="code" href="classTiXmlAttribute.html#a9">00744</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#a9">SetName</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _name )   { name = _name; }
561<a name="l00745"></a><a class="code" href="classTiXmlAttribute.html#a10">00745</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#a10">SetValue</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _value ) { value = _value; }
562<a name="l00746"></a>00746
563<a name="l00747"></a>00747     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#a11">SetIntValue</a>( <span class="keywordtype">int</span> _value );
564<a name="l00748"></a>00748     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#a12">SetDoubleValue</a>( <span class="keywordtype">double</span> _value );
565<a name="l00749"></a>00749
566<a name="l00750"></a>00750 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
567<a name="l00751"></a>00751 <span class="preprocessor"></span>
568<a name="l00752"></a><a class="code" href="classTiXmlAttribute.html#a13">00752</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#a9">SetName</a>( <span class="keyword">const</span> std::string&amp; _name )
569<a name="l00753"></a>00753     {
570<a name="l00754"></a>00754         StringToBuffer buf( _name );
571<a name="l00755"></a>00755         <a class="code" href="classTiXmlAttribute.html#a9">SetName</a> ( buf.buffer ? buf.buffer : <span class="stringliteral">"error"</span> );
572<a name="l00756"></a>00756     }
573<a name="l00758"></a><a class="code" href="classTiXmlAttribute.html#a14">00758</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#a10">SetValue</a>( <span class="keyword">const</span> std::string&amp; _value )
574<a name="l00759"></a>00759     {
575<a name="l00760"></a>00760         StringToBuffer buf( _value );
576<a name="l00761"></a>00761         <a class="code" href="classTiXmlAttribute.html#a10">SetValue</a>( buf.buffer ? buf.buffer : <span class="stringliteral">"error"</span> );
577<a name="l00762"></a>00762     }
578<a name="l00763"></a>00763 <span class="preprocessor">    #endif</span>
579<a name="l00764"></a>00764 <span class="preprocessor"></span>
580<a name="l00766"></a>00766     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#a15">Next</a>() <span class="keyword">const</span>;
581<a name="l00767"></a>00767     <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#a15">Next</a>();
582<a name="l00769"></a>00769     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#a17">Previous</a>() <span class="keyword">const</span>;
583<a name="l00770"></a>00770     <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#a17">Previous</a>();
584<a name="l00771"></a>00771
585<a name="l00772"></a>00772     <span class="keywordtype">bool</span> operator==( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>&amp; rhs )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rhs.<a class="code" href="classTiXmlAttribute.html#r1">name</a> == name; }
586<a name="l00773"></a>00773     <span class="keywordtype">bool</span> operator&lt;( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>&amp; rhs )<span class="keyword">  const </span>{ <span class="keywordflow">return</span> name &lt; rhs.<a class="code" href="classTiXmlAttribute.html#r1">name</a>; }
587<a name="l00774"></a>00774     <span class="keywordtype">bool</span> operator&gt;( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>&amp; rhs )<span class="keyword">  const </span>{ <span class="keywordflow">return</span> name &gt; rhs.<a class="code" href="classTiXmlAttribute.html#r1">name</a>; }
588<a name="l00775"></a>00775
589<a name="l00776"></a>00776     <span class="comment">/*  Attribute parsing starts: first letter of the name</span>
590<a name="l00777"></a>00777 <span class="comment">                         returns: the next char after the value end quote</span>
591<a name="l00778"></a>00778 <span class="comment">    */</span>
592<a name="l00779"></a>00779     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
593<a name="l00780"></a>00780
594<a name="l00781"></a>00781     <span class="comment">// Prints this Attribute to a FILE stream.</span>
595<a name="l00782"></a>00782     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#a23">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>;
596<a name="l00783"></a>00783
597<a name="l00784"></a>00784     <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamOut( TIXML_OSTREAM * out ) <span class="keyword">const</span>;
598<a name="l00785"></a>00785     <span class="comment">// [internal use]</span>
599<a name="l00786"></a>00786     <span class="comment">// Set the document pointer so the attribute can report errors.</span>
600<a name="l00787"></a>00787     <span class="keywordtype">void</span> SetDocument( <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* doc )  { document = doc; }
601<a name="l00788"></a>00788
602<a name="l00789"></a>00789 <span class="keyword">private</span>:
603<a name="l00790"></a>00790     <a class="code" href="classTiXmlAttribute.html#a0">TiXmlAttribute</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>&amp; );                <span class="comment">// not implemented.</span>
604<a name="l00791"></a>00791     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>&amp; base );   <span class="comment">// not allowed.</span>
605<a name="l00792"></a>00792
606<a name="l00793"></a>00793     <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>*  document;   <span class="comment">// A pointer back to a document, for error reporting.</span>
607<a name="l00794"></a>00794     TIXML_STRING name;
608<a name="l00795"></a>00795     TIXML_STRING value;
609<a name="l00796"></a>00796     <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* prev;
610<a name="l00797"></a>00797     <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* next;
611<a name="l00798"></a>00798 };
612<a name="l00799"></a>00799
613<a name="l00800"></a>00800
614<a name="l00801"></a>00801 <span class="comment">/*  A class used to manage a group of attributes.</span>
615<a name="l00802"></a>00802 <span class="comment">    It is only used internally, both by the ELEMENT and the DECLARATION.</span>
616<a name="l00803"></a>00803 <span class="comment">    </span>
617<a name="l00804"></a>00804 <span class="comment">    The set can be changed transparent to the Element and Declaration</span>
618<a name="l00805"></a>00805 <span class="comment">    classes that use it, but NOT transparent to the Attribute</span>
619<a name="l00806"></a>00806 <span class="comment">    which has to implement a next() and previous() method. Which makes</span>
620<a name="l00807"></a>00807 <span class="comment">    it a bit problematic and prevents the use of STL.</span>
621<a name="l00808"></a>00808 <span class="comment"></span>
622<a name="l00809"></a>00809 <span class="comment">    This version is implemented with circular lists because:</span>
623<a name="l00810"></a>00810 <span class="comment">        - I like circular lists</span>
624<a name="l00811"></a>00811 <span class="comment">        - it demonstrates some independence from the (typical) doubly linked list.</span>
625<a name="l00812"></a>00812 <span class="comment">*/</span>
626<a name="l00813"></a>00813 <span class="keyword">class </span>TiXmlAttributeSet
627<a name="l00814"></a>00814 {
628<a name="l00815"></a>00815 <span class="keyword">public</span>:
629<a name="l00816"></a>00816     TiXmlAttributeSet();
630<a name="l00817"></a>00817     ~TiXmlAttributeSet();
631<a name="l00818"></a>00818
632<a name="l00819"></a>00819     <span class="keywordtype">void</span> Add( <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* attribute );
633<a name="l00820"></a>00820     <span class="keywordtype">void</span> Remove( <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* attribute );
634<a name="l00821"></a>00821
635<a name="l00822"></a>00822     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* First()<span class="keyword">   const   </span>{ <span class="keywordflow">return</span> ( sentinel.next == &amp;sentinel ) ? 0 : sentinel.next; }
636<a name="l00823"></a>00823     <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* First()                 { <span class="keywordflow">return</span> ( sentinel.next == &amp;sentinel ) ? 0 : sentinel.next; }
637<a name="l00824"></a>00824     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* Last()<span class="keyword"> const      </span>{ <span class="keywordflow">return</span> ( sentinel.prev == &amp;sentinel ) ? 0 : sentinel.prev; }
638<a name="l00825"></a>00825     <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* Last()                  { <span class="keywordflow">return</span> ( sentinel.prev == &amp;sentinel ) ? 0 : sentinel.prev; }
639<a name="l00826"></a>00826
640<a name="l00827"></a>00827     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>*   Find( <span class="keyword">const</span> <span class="keywordtype">char</span> * name ) <span class="keyword">const</span>;
641<a name="l00828"></a>00828     <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* Find( <span class="keyword">const</span> <span class="keywordtype">char</span> * name );
642<a name="l00829"></a>00829
643<a name="l00830"></a>00830 <span class="keyword">private</span>:
644<a name="l00831"></a>00831     <span class="comment">//*ME:  Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element),</span>
645<a name="l00832"></a>00832     <span class="comment">//*ME:  this class must be also use a hidden/disabled copy-constructor !!!</span>
646<a name="l00833"></a>00833     TiXmlAttributeSet( <span class="keyword">const</span> TiXmlAttributeSet&amp; );  <span class="comment">// not allowed</span>
647<a name="l00834"></a>00834     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> TiXmlAttributeSet&amp; ); <span class="comment">// not allowed (as TiXmlAttribute)</span>
648<a name="l00835"></a>00835
649<a name="l00836"></a>00836     <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a> sentinel;
650<a name="l00837"></a>00837 };
651<a name="l00838"></a>00838
652<a name="l00839"></a>00839
653<a name="l00844"></a><a class="code" href="classTiXmlElement.html">00844</a> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>
654<a name="l00845"></a>00845 {
655<a name="l00846"></a>00846 <span class="keyword">public</span>:
656<a name="l00848"></a>00848     <a class="code" href="classTiXmlElement.html#a0">TiXmlElement</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> * in_value);
657<a name="l00849"></a>00849
658<a name="l00850"></a>00850 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
659<a name="l00851"></a>00851 <span class="preprocessor"></span>
660<a name="l00852"></a>00852     <a class="code" href="classTiXmlElement.html#a0">TiXmlElement</a>( <span class="keyword">const</span> std::string&amp; _value );
661<a name="l00853"></a>00853 <span class="preprocessor">    #endif</span>
662<a name="l00854"></a>00854 <span class="preprocessor"></span>
663<a name="l00855"></a>00855     <a class="code" href="classTiXmlElement.html#a0">TiXmlElement</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>&amp; );
664<a name="l00856"></a>00856
665<a name="l00857"></a>00857     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>&amp; base );
666<a name="l00858"></a>00858
667<a name="l00859"></a>00859     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlElement.html">TiXmlElement</a>();
668<a name="l00860"></a>00860
669<a name="l00864"></a>00864     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#a5">Attribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name ) <span class="keyword">const</span>;
670<a name="l00865"></a>00865
671<a name="l00872"></a>00872     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#a5">Attribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">int</span>* i ) <span class="keyword">const</span>;
672<a name="l00873"></a>00873
673<a name="l00880"></a>00880     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#a5">Attribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">double</span>* d ) <span class="keyword">const</span>;
674<a name="l00881"></a>00881
675<a name="l00889"></a>00889     <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#a8">QueryIntAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">int</span>* _value ) <span class="keyword">const</span>;
676<a name="l00891"></a>00891     <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#a9">QueryDoubleAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">double</span>* _value ) <span class="keyword">const</span>;
677<a name="l00893"></a><a class="code" href="classTiXmlElement.html#a10">00893</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#a10">QueryFloatAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">float</span>* _value )<span class="keyword"> const </span>{
678<a name="l00894"></a>00894         <span class="keywordtype">double</span> d;
679<a name="l00895"></a>00895         <span class="keywordtype">int</span> result = <a class="code" href="classTiXmlElement.html#a9">QueryDoubleAttribute</a>( name, &amp;d );
680<a name="l00896"></a>00896         <span class="keywordflow">if</span> ( result == TIXML_SUCCESS ) {
681<a name="l00897"></a>00897             *_value = (float)d;
682<a name="l00898"></a>00898         }
683<a name="l00899"></a>00899         <span class="keywordflow">return</span> result;
684<a name="l00900"></a>00900     }
685<a name="l00901"></a>00901
686<a name="l00905"></a>00905     <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#a11">SetAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keyword">const</span> <span class="keywordtype">char</span> * _value );
687<a name="l00906"></a>00906
688<a name="l00907"></a>00907 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
689<a name="l00908"></a>00908 <span class="preprocessor"></span>    <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#a5">Attribute</a>( <span class="keyword">const</span> std::string&amp; name )<span class="keyword"> const              </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlElement.html#a5">Attribute</a>( name.c_str() ); }
690<a name="l00909"></a>00909     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#a5">Attribute</a>( <span class="keyword">const</span> std::string&amp; name, <span class="keywordtype">int</span>* i )<span class="keyword"> const      </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlElement.html#a5">Attribute</a>( name.c_str(), i ); }
691<a name="l00910"></a>00910     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#a5">Attribute</a>( <span class="keyword">const</span> std::string&amp; name, <span class="keywordtype">double</span>* d )<span class="keyword"> const   </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlElement.html#a5">Attribute</a>( name.c_str(), d ); }
692<a name="l00911"></a>00911     <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#a8">QueryIntAttribute</a>( <span class="keyword">const</span> std::string&amp; name, <span class="keywordtype">int</span>* _value )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlElement.html#a8">QueryIntAttribute</a>( name.c_str(), _value ); }
693<a name="l00912"></a>00912     <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#a9">QueryDoubleAttribute</a>( <span class="keyword">const</span> std::string&amp; name, <span class="keywordtype">double</span>* _value )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlElement.html#a9">QueryDoubleAttribute</a>( name.c_str(), _value ); }
694<a name="l00913"></a>00913
695<a name="l00915"></a><a class="code" href="classTiXmlElement.html#a17">00915</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#a11">SetAttribute</a>( <span class="keyword">const</span> std::string&amp; name, <span class="keyword">const</span> std::string&amp; _value )
696<a name="l00916"></a>00916     {
697<a name="l00917"></a>00917         StringToBuffer n( name );
698<a name="l00918"></a>00918         StringToBuffer v( _value );
699<a name="l00919"></a>00919         <span class="keywordflow">if</span> ( n.buffer &amp;&amp; v.buffer )
700<a name="l00920"></a>00920             <a class="code" href="classTiXmlElement.html#a11">SetAttribute</a> (n.buffer, v.buffer );
701<a name="l00921"></a>00921     }
702<a name="l00923"></a>00923     <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#a11">SetAttribute</a>( <span class="keyword">const</span> std::string&amp; name, <span class="keywordtype">int</span> _value )
703<a name="l00924"></a>00924     {
704<a name="l00925"></a>00925         StringToBuffer n( name );
705<a name="l00926"></a>00926         <span class="keywordflow">if</span> ( n.buffer )
706<a name="l00927"></a>00927             <a class="code" href="classTiXmlElement.html#a11">SetAttribute</a> (n.buffer, _value);
707<a name="l00928"></a>00928     }
708<a name="l00929"></a>00929 <span class="preprocessor">    #endif</span>
709<a name="l00930"></a>00930 <span class="preprocessor"></span>
710<a name="l00934"></a>00934     <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#a11">SetAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * name, <span class="keywordtype">int</span> value );
711<a name="l00935"></a>00935
712<a name="l00939"></a>00939     <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#a20">SetDoubleAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * name, <span class="keywordtype">double</span> value );
713<a name="l00940"></a>00940
714<a name="l00943"></a>00943     <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#a21">RemoveAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * name );
715<a name="l00944"></a>00944 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
716<a name="l00945"></a><a class="code" href="classTiXmlElement.html#a22">00945</a> <span class="preprocessor"></span>    <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#a21">RemoveAttribute</a>( <span class="keyword">const</span> std::string&amp; name ) {   <a class="code" href="classTiXmlElement.html#a21">RemoveAttribute</a> (name.c_str ());    }
717<a name="l00946"></a>00946 <span class="preprocessor">    #endif</span>
718<a name="l00947"></a>00947 <span class="preprocessor"></span>
719<a name="l00948"></a><a class="code" href="classTiXmlElement.html#a23">00948</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlElement.html#a23">FirstAttribute</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span> attributeSet.First(); }
720<a name="l00949"></a>00949     <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlElement.html#a23">FirstAttribute</a>()                { <span class="keywordflow">return</span> attributeSet.First(); }
721<a name="l00950"></a><a class="code" href="classTiXmlElement.html#a25">00950</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlElement.html#a25">LastAttribute</a>()<span class="keyword">   const   </span>{ <span class="keywordflow">return</span> attributeSet.Last(); }
722<a name="l00951"></a>00951     <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlElement.html#a25">LastAttribute</a>()                 { <span class="keywordflow">return</span> attributeSet.Last(); }
723<a name="l00952"></a>00952
724<a name="l00985"></a>00985     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#a27">GetText</a>() <span class="keyword">const</span>;
725<a name="l00986"></a>00986
726<a name="l00988"></a>00988     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlElement.html#a28">Clone</a>() <span class="keyword">const</span>;
727<a name="l00989"></a>00989     <span class="comment">// Print the Element to a FILE stream.</span>
728<a name="l00990"></a>00990     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#a29">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>;
729<a name="l00991"></a>00991
730<a name="l00992"></a>00992     <span class="comment">/*  Attribtue parsing starts: next char past '&lt;'</span>
731<a name="l00993"></a>00993 <span class="comment">                         returns: next char past '&gt;'</span>
732<a name="l00994"></a>00994 <span class="comment">    */</span>
733<a name="l00995"></a>00995     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
734<a name="l00996"></a>00996
735<a name="l00997"></a>00997 <span class="keyword">protected</span>:
736<a name="l00998"></a>00998
737<a name="l00999"></a>00999     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* target ) <span class="keyword">const</span>;
738<a name="l01000"></a>01000     <span class="keywordtype">void</span> ClearThis();   <span class="comment">// like clear, but initializes 'this' object as well</span>
739<a name="l01001"></a>01001
740<a name="l01002"></a>01002     <span class="comment">// Used to be public [internal use]</span>
741<a name="l01003"></a>01003 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
742<a name="l01004"></a>01004 <span class="preprocessor"></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag );
743<a name="l01005"></a>01005 <span class="preprocessor">    #endif</span>
744<a name="l01006"></a>01006 <span class="preprocessor"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamOut( TIXML_OSTREAM * out ) <span class="keyword">const</span>;
745<a name="l01007"></a>01007
746<a name="l01008"></a>01008     <span class="comment">/*  [internal use]</span>
747<a name="l01009"></a>01009 <span class="comment">        Reads the "value" of the element -- another element, or text.</span>
748<a name="l01010"></a>01010 <span class="comment">        This should terminate with the current end tag.</span>
749<a name="l01011"></a>01011 <span class="comment">    */</span>
750<a name="l01012"></a>01012     <span class="keyword">const</span> <span class="keywordtype">char</span>* ReadValue( <span class="keyword">const</span> <span class="keywordtype">char</span>* in, TiXmlParsingData* prevData, TiXmlEncoding encoding );
751<a name="l01013"></a>01013
752<a name="l01014"></a>01014 <span class="keyword">private</span>:
753<a name="l01015"></a>01015
754<a name="l01016"></a>01016     TiXmlAttributeSet attributeSet;
755<a name="l01017"></a>01017 };
756<a name="l01018"></a>01018
757<a name="l01019"></a>01019
758<a name="l01022"></a><a class="code" href="classTiXmlComment.html">01022</a> <span class="keyword">class </span><a class="code" href="classTiXmlComment.html">TiXmlComment</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>
759<a name="l01023"></a>01023 {
760<a name="l01024"></a>01024 <span class="keyword">public</span>:
761<a name="l01026"></a><a class="code" href="classTiXmlComment.html#a0">01026</a>     <a class="code" href="classTiXmlComment.html#a0">TiXmlComment</a>() : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>::COMMENT ) {}
762<a name="l01027"></a>01027     <a class="code" href="classTiXmlComment.html#a0">TiXmlComment</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>&amp; );
763<a name="l01028"></a>01028     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>&amp; base );
764<a name="l01029"></a>01029
765<a name="l01030"></a>01030     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlComment.html">TiXmlComment</a>() {}
766<a name="l01031"></a>01031
767<a name="l01033"></a>01033     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlComment.html#a4">Clone</a>() <span class="keyword">const</span>;
768<a name="l01035"></a>01035     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlComment.html#a5">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>;
769<a name="l01036"></a>01036
770<a name="l01037"></a>01037     <span class="comment">/*  Attribtue parsing starts: at the ! of the !--</span>
771<a name="l01038"></a>01038 <span class="comment">                         returns: next char past '&gt;'</span>
772<a name="l01039"></a>01039 <span class="comment">    */</span>
773<a name="l01040"></a>01040     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
774<a name="l01041"></a>01041
775<a name="l01042"></a>01042 <span class="keyword">protected</span>:
776<a name="l01043"></a>01043     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlComment.html">TiXmlComment</a>* target ) <span class="keyword">const</span>;
777<a name="l01044"></a>01044
778<a name="l01045"></a>01045     <span class="comment">// used to be public</span>
779<a name="l01046"></a>01046 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
780<a name="l01047"></a>01047 <span class="preprocessor"></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag );
781<a name="l01048"></a>01048 <span class="preprocessor">    #endif</span>
782<a name="l01049"></a>01049 <span class="preprocessor"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamOut( TIXML_OSTREAM * out ) <span class="keyword">const</span>;
783<a name="l01050"></a>01050
784<a name="l01051"></a>01051 <span class="keyword">private</span>:
785<a name="l01052"></a>01052
786<a name="l01053"></a>01053 };
787<a name="l01054"></a>01054
788<a name="l01055"></a>01055
789<a name="l01061"></a><a class="code" href="classTiXmlText.html">01061</a> <span class="keyword">class </span><a class="code" href="classTiXmlText.html">TiXmlText</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>
790<a name="l01062"></a>01062 {
791<a name="l01063"></a>01063     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a>;
792<a name="l01064"></a>01064 <span class="keyword">public</span>:
793<a name="l01069"></a><a class="code" href="classTiXmlText.html#a0">01069</a>     <a class="code" href="classTiXmlText.html#a0">TiXmlText</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> * initValue ) : <a class="code" href="classTiXmlNode.html">TiXmlNode</a> (<a class="code" href="classTiXmlNode.html">TiXmlNode</a>::TEXT)
794<a name="l01070"></a>01070     {
795<a name="l01071"></a>01071         <a class="code" href="classTiXmlNode.html#a3">SetValue</a>( initValue );
796<a name="l01072"></a>01072         cdata = <span class="keyword">false</span>;
797<a name="l01073"></a>01073     }
798<a name="l01074"></a>01074     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlText.html">TiXmlText</a>() {}
799<a name="l01075"></a>01075
800<a name="l01076"></a>01076 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
801<a name="l01077"></a>01077 <span class="preprocessor"></span>
802<a name="l01078"></a><a class="code" href="classTiXmlText.html#a2">01078</a>     <a class="code" href="classTiXmlText.html#a0">TiXmlText</a>( <span class="keyword">const</span> std::string&amp; initValue ) : <a class="code" href="classTiXmlNode.html">TiXmlNode</a> (<a class="code" href="classTiXmlNode.html">TiXmlNode</a>::TEXT)
803<a name="l01079"></a>01079     {
804<a name="l01080"></a>01080         <a class="code" href="classTiXmlNode.html#a3">SetValue</a>( initValue );
805<a name="l01081"></a>01081         cdata = <span class="keyword">false</span>;
806<a name="l01082"></a>01082     }
807<a name="l01083"></a>01083 <span class="preprocessor">    #endif</span>
808<a name="l01084"></a>01084 <span class="preprocessor"></span>
809<a name="l01085"></a>01085     <a class="code" href="classTiXmlText.html#a0">TiXmlText</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>&amp; copy ) : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>::TEXT )   { copy.<a class="code" href="classTiXmlText.html#b1">CopyTo</a>( <span class="keyword">this</span> ); }
810<a name="l01086"></a>01086     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>&amp; base )                             { base.<a class="code" href="classTiXmlText.html#b1">CopyTo</a>( <span class="keyword">this</span> ); }
811<a name="l01087"></a>01087
812<a name="l01089"></a>01089     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlText.html#a5">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>;
813<a name="l01090"></a>01090
814<a name="l01092"></a><a class="code" href="classTiXmlText.html#a6">01092</a>     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlText.html#a6">CDATA</a>()                    { <span class="keywordflow">return</span> cdata; }
815<a name="l01094"></a><a class="code" href="classTiXmlText.html#a7">01094</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlText.html#a7">SetCDATA</a>( <span class="keywordtype">bool</span> _cdata )    { cdata = _cdata; }
816<a name="l01095"></a>01095
817<a name="l01096"></a>01096     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
818<a name="l01097"></a>01097
819<a name="l01098"></a>01098 <span class="keyword">protected</span> :
820<a name="l01100"></a>01100     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlText.html#b0">Clone</a>() <span class="keyword">const</span>;
821<a name="l01101"></a>01101     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlText.html">TiXmlText</a>* target ) <span class="keyword">const</span>;
822<a name="l01102"></a>01102
823<a name="l01103"></a>01103     <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamOut ( TIXML_OSTREAM * out ) <span class="keyword">const</span>;
824<a name="l01104"></a>01104     <span class="keywordtype">bool</span> Blank() <span class="keyword">const</span>; <span class="comment">// returns true if all white space and new lines</span>
825<a name="l01105"></a>01105     <span class="comment">// [internal use]</span>
826<a name="l01106"></a>01106 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
827<a name="l01107"></a>01107 <span class="preprocessor"></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag );
828<a name="l01108"></a>01108 <span class="preprocessor">    #endif</span>
829<a name="l01109"></a>01109 <span class="preprocessor"></span>
830<a name="l01110"></a>01110 <span class="keyword">private</span>:
831<a name="l01111"></a>01111     <span class="keywordtype">bool</span> cdata;         <span class="comment">// true if this should be input and output as a CDATA style text element</span>
832<a name="l01112"></a>01112 };
833<a name="l01113"></a>01113
834<a name="l01114"></a>01114
835<a name="l01128"></a><a class="code" href="classTiXmlDeclaration.html">01128</a> <span class="keyword">class </span><a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>
836<a name="l01129"></a>01129 {
837<a name="l01130"></a>01130 <span class="keyword">public</span>:
838<a name="l01132"></a><a class="code" href="classTiXmlDeclaration.html#a0">01132</a>     <a class="code" href="classTiXmlDeclaration.html#a0">TiXmlDeclaration</a>()   : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>::DECLARATION ) {}
839<a name="l01133"></a>01133
840<a name="l01134"></a>01134 <span class="preprocessor">#ifdef TIXML_USE_STL</span>
841<a name="l01135"></a>01135 <span class="preprocessor"></span>
842<a name="l01136"></a>01136     <a class="code" href="classTiXmlDeclaration.html#a0">TiXmlDeclaration</a>(   <span class="keyword">const</span> std::string&amp; _version,
843<a name="l01137"></a>01137                         <span class="keyword">const</span> std::string&amp; _encoding,
844<a name="l01138"></a>01138                         <span class="keyword">const</span> std::string&amp; _standalone );
845<a name="l01139"></a>01139 <span class="preprocessor">#endif</span>
846<a name="l01140"></a>01140 <span class="preprocessor"></span>
847<a name="l01142"></a>01142     <a class="code" href="classTiXmlDeclaration.html#a0">TiXmlDeclaration</a>(   <span class="keyword">const</span> <span class="keywordtype">char</span>* _version,
848<a name="l01143"></a>01143                         <span class="keyword">const</span> <span class="keywordtype">char</span>* _encoding,
849<a name="l01144"></a>01144                         <span class="keyword">const</span> <span class="keywordtype">char</span>* _standalone );
850<a name="l01145"></a>01145
851<a name="l01146"></a>01146     <a class="code" href="classTiXmlDeclaration.html#a0">TiXmlDeclaration</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>&amp; copy );
852<a name="l01147"></a>01147     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>&amp; copy );
853<a name="l01148"></a>01148
854<a name="l01149"></a>01149     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>() {}
855<a name="l01150"></a>01150
856<a name="l01152"></a><a class="code" href="classTiXmlDeclaration.html#a6">01152</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlDeclaration.html#a6">Version</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> version.c_str (); }
857<a name="l01154"></a><a class="code" href="classTiXmlDeclaration.html#a7">01154</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlDeclaration.html#a7">Encoding</a>()<span class="keyword"> const        </span>{ <span class="keywordflow">return</span> encoding.c_str (); }
858<a name="l01156"></a><a class="code" href="classTiXmlDeclaration.html#a8">01156</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlDeclaration.html#a8">Standalone</a>()<span class="keyword"> const      </span>{ <span class="keywordflow">return</span> standalone.c_str (); }
859<a name="l01157"></a>01157
860<a name="l01159"></a>01159     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlDeclaration.html#a9">Clone</a>() <span class="keyword">const</span>;
861<a name="l01161"></a>01161     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlDeclaration.html#a10">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>;
862<a name="l01162"></a>01162
863<a name="l01163"></a>01163     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
864<a name="l01164"></a>01164
865<a name="l01165"></a>01165 <span class="keyword">protected</span>:
866<a name="l01166"></a>01166     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>* target ) <span class="keyword">const</span>;
867<a name="l01167"></a>01167     <span class="comment">// used to be public</span>
868<a name="l01168"></a>01168 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
869<a name="l01169"></a>01169 <span class="preprocessor"></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag );
870<a name="l01170"></a>01170 <span class="preprocessor">    #endif</span>
871<a name="l01171"></a>01171 <span class="preprocessor"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamOut ( TIXML_OSTREAM * out) <span class="keyword">const</span>;
872<a name="l01172"></a>01172
873<a name="l01173"></a>01173 <span class="keyword">private</span>:
874<a name="l01174"></a>01174
875<a name="l01175"></a>01175     TIXML_STRING version;
876<a name="l01176"></a>01176     TIXML_STRING encoding;
877<a name="l01177"></a>01177     TIXML_STRING standalone;
878<a name="l01178"></a>01178 };
879<a name="l01179"></a>01179
880<a name="l01180"></a>01180
881<a name="l01188"></a><a class="code" href="classTiXmlUnknown.html">01188</a> <span class="keyword">class </span><a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>
882<a name="l01189"></a>01189 {
883<a name="l01190"></a>01190 <span class="keyword">public</span>:
884<a name="l01191"></a>01191     <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>() : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( TiXmlNode::UNKNOWN )    {}
885<a name="l01192"></a>01192     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>() {}
886<a name="l01193"></a>01193
887<a name="l01194"></a>01194     <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>&amp; copy ) : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( TiXmlNode::UNKNOWN )      { copy.<a class="code" href="classTiXmlUnknown.html#b0">CopyTo</a>( <span class="keyword">this</span> ); }
888<a name="l01195"></a>01195     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>&amp; copy )                                      { copy.<a class="code" href="classTiXmlUnknown.html#b0">CopyTo</a>( <span class="keyword">this</span> ); }
889<a name="l01196"></a>01196
890<a name="l01198"></a>01198     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlUnknown.html#a4">Clone</a>() <span class="keyword">const</span>;
891<a name="l01200"></a>01200     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlUnknown.html#a5">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>;
892<a name="l01201"></a>01201
893<a name="l01202"></a>01202     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
894<a name="l01203"></a>01203
895<a name="l01204"></a>01204 <span class="keyword">protected</span>:
896<a name="l01205"></a>01205     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>* target ) <span class="keyword">const</span>;
897<a name="l01206"></a>01206
898<a name="l01207"></a>01207 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
899<a name="l01208"></a>01208 <span class="preprocessor"></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag );
900<a name="l01209"></a>01209 <span class="preprocessor">    #endif</span>
901<a name="l01210"></a>01210 <span class="preprocessor"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamOut ( TIXML_OSTREAM * out ) <span class="keyword">const</span>;
902<a name="l01211"></a>01211
903<a name="l01212"></a>01212 <span class="keyword">private</span>:
904<a name="l01213"></a>01213
905<a name="l01214"></a>01214 };
906<a name="l01215"></a>01215
907<a name="l01216"></a>01216
908<a name="l01221"></a><a class="code" href="classTiXmlDocument.html">01221</a> <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html">TiXmlDocument</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>
909<a name="l01222"></a>01222 {
910<a name="l01223"></a>01223 <span class="keyword">public</span>:
911<a name="l01225"></a>01225     <a class="code" href="classTiXmlDocument.html#a0">TiXmlDocument</a>();
912<a name="l01227"></a>01227     <a class="code" href="classTiXmlDocument.html#a0">TiXmlDocument</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * documentName );
913<a name="l01228"></a>01228
914<a name="l01229"></a>01229 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
915<a name="l01230"></a>01230 <span class="preprocessor"></span>
916<a name="l01231"></a>01231     <a class="code" href="classTiXmlDocument.html#a0">TiXmlDocument</a>( <span class="keyword">const</span> std::string&amp; documentName );
917<a name="l01232"></a>01232 <span class="preprocessor">    #endif</span>
918<a name="l01233"></a>01233 <span class="preprocessor"></span>
919<a name="l01234"></a>01234     <a class="code" href="classTiXmlDocument.html#a0">TiXmlDocument</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>&amp; copy );
920<a name="l01235"></a>01235     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>&amp; copy );
921<a name="l01236"></a>01236
922<a name="l01237"></a>01237     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>() {}
923<a name="l01238"></a>01238
924<a name="l01243"></a>01243     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a6">LoadFile</a>( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
925<a name="l01245"></a>01245     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a7">SaveFile</a>() <span class="keyword">const</span>;
926<a name="l01247"></a>01247     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a6">LoadFile</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
927<a name="l01249"></a>01249     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a7">SaveFile</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * filename ) <span class="keyword">const</span>;
928<a name="l01250"></a>01250
929<a name="l01251"></a>01251 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
930<a name="l01252"></a><a class="code" href="classTiXmlDocument.html#a10">01252</a> <span class="preprocessor"></span>    <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a6">LoadFile</a>( <span class="keyword">const</span> std::string&amp; filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING )
931<a name="l01253"></a>01253     {
932<a name="l01254"></a>01254         StringToBuffer f( filename );
933<a name="l01255"></a>01255         <span class="keywordflow">return</span> ( f.buffer &amp;&amp; LoadFile( f.buffer, encoding ));
934<a name="l01256"></a>01256     }
935<a name="l01257"></a><a class="code" href="classTiXmlDocument.html#a11">01257</a>     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a7">SaveFile</a>( <span class="keyword">const</span> std::string&amp; filename ) <span class="keyword">const</span>
936<a name="l01258"></a>01258     {
937<a name="l01259"></a>01259         StringToBuffer f( filename );
938<a name="l01260"></a>01260         <span class="keywordflow">return</span> ( f.buffer &amp;&amp; SaveFile( f.buffer ));
939<a name="l01261"></a>01261     }
940<a name="l01262"></a>01262 <span class="preprocessor">    #endif</span>
941<a name="l01263"></a>01263 <span class="preprocessor"></span>
942<a name="l01268"></a>01268     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlDocument.html#a12">Parse</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
943<a name="l01269"></a>01269
944<a name="l01274"></a><a class="code" href="classTiXmlDocument.html#a13">01274</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlDocument.html#a13">RootElement</a>()<span class="keyword"> const     </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a50">FirstChildElement</a>(); }
945<a name="l01275"></a>01275     <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlDocument.html#a13">RootElement</a>()                 { <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a50">FirstChildElement</a>(); }
946<a name="l01276"></a>01276
947<a name="l01282"></a><a class="code" href="classTiXmlDocument.html#a15">01282</a>     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a15">Error</a>()<span class="keyword"> const                      </span>{ <span class="keywordflow">return</span> error; }
948<a name="l01283"></a>01283
949<a name="l01285"></a><a class="code" href="classTiXmlDocument.html#a16">01285</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="classTiXmlDocument.html#a16">ErrorDesc</a>()<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> errorDesc.c_str (); }
950<a name="l01286"></a>01286
951<a name="l01290"></a><a class="code" href="classTiXmlDocument.html#a17">01290</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlDocument.html#a17">ErrorId</a>()<span class="keyword">   const               </span>{ <span class="keywordflow">return</span> errorId; }
952<a name="l01291"></a>01291
953<a name="l01299"></a><a class="code" href="classTiXmlDocument.html#a18">01299</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlDocument.html#a18">ErrorRow</a>()  { <span class="keywordflow">return</span> errorLocation.row+1; }
954<a name="l01300"></a><a class="code" href="classTiXmlDocument.html#a19">01300</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlDocument.html#a19">ErrorCol</a>()  { <span class="keywordflow">return</span> errorLocation.col+1; }
955<a name="l01301"></a>01301
956<a name="l01326"></a><a class="code" href="classTiXmlDocument.html#a20">01326</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#a20">SetTabSize</a>( <span class="keywordtype">int</span> _tabsize )     { tabsize = _tabsize; }
957<a name="l01327"></a>01327
958<a name="l01328"></a>01328     <span class="keywordtype">int</span> TabSize()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> tabsize; }
959<a name="l01329"></a>01329
960<a name="l01333"></a><a class="code" href="classTiXmlDocument.html#a22">01333</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#a22">ClearError</a>()                       {   error = <span class="keyword">false</span>;
961<a name="l01334"></a>01334                                                 errorId = 0;
962<a name="l01335"></a>01335                                                 errorDesc = <span class="stringliteral">""</span>;
963<a name="l01336"></a>01336                                                 errorLocation.row = errorLocation.col = 0;
964<a name="l01337"></a>01337                                                 <span class="comment">//errorLocation.last = 0; </span>
965<a name="l01338"></a>01338                                             }
966<a name="l01339"></a>01339
967<a name="l01341"></a><a class="code" href="classTiXmlDocument.html#a23">01341</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#a23">Print</a>()<span class="keyword"> const                      </span>{ <a class="code" href="classTiXmlDocument.html#a23">Print</a>( stdout, 0 ); }
968<a name="l01342"></a>01342
969<a name="l01344"></a>01344     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#a23">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth = 0 ) <span class="keyword">const</span>;
970<a name="l01345"></a>01345     <span class="comment">// [internal use]</span>
971<a name="l01346"></a>01346     <span class="keywordtype">void</span> SetError( <span class="keywordtype">int</span> err, <span class="keyword">const</span> <span class="keywordtype">char</span>* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding );
972<a name="l01347"></a>01347
973<a name="l01348"></a>01348 <span class="keyword">protected</span> :
974<a name="l01349"></a>01349     <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamOut ( TIXML_OSTREAM * out) <span class="keyword">const</span>;
975<a name="l01350"></a>01350     <span class="comment">// [internal use]</span>
976<a name="l01351"></a>01351     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlDocument.html#b1">Clone</a>() <span class="keyword">const</span>;
977<a name="l01352"></a>01352 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
978<a name="l01353"></a>01353 <span class="preprocessor"></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag );
979<a name="l01354"></a>01354 <span class="preprocessor">    #endif</span>
980<a name="l01355"></a>01355 <span class="preprocessor"></span>
981<a name="l01356"></a>01356 <span class="keyword">private</span>:
982<a name="l01357"></a>01357     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* target ) <span class="keyword">const</span>;
983<a name="l01358"></a>01358
984<a name="l01359"></a>01359     <span class="keywordtype">bool</span> error;
985<a name="l01360"></a>01360     <span class="keywordtype">int</span>  errorId;
986<a name="l01361"></a>01361     TIXML_STRING errorDesc;
987<a name="l01362"></a>01362     <span class="keywordtype">int</span> tabsize;
988<a name="l01363"></a>01363     TiXmlCursor errorLocation;
989<a name="l01364"></a>01364     <span class="keywordtype">bool</span> useMicrosoftBOM;       <span class="comment">// the UTF-8 BOM were found when read. Note this, and try to write.</span>
990<a name="l01365"></a>01365 };
991<a name="l01366"></a>01366
992<a name="l01367"></a>01367
993<a name="l01448"></a><a class="code" href="classTiXmlHandle.html">01448</a> <span class="keyword">class </span><a class="code" href="classTiXmlHandle.html">TiXmlHandle</a>
994<a name="l01449"></a>01449 {
995<a name="l01450"></a>01450 <span class="keyword">public</span>:
996<a name="l01452"></a><a class="code" href="classTiXmlHandle.html#a0">01452</a>     <a class="code" href="classTiXmlHandle.html#a0">TiXmlHandle</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* _node )                 { this-&gt;node = _node; }
997<a name="l01454"></a><a class="code" href="classTiXmlHandle.html#a1">01454</a>     <a class="code" href="classTiXmlHandle.html#a0">TiXmlHandle</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a>&amp; ref )           { this-&gt;node = ref.<a class="code" href="classTiXmlHandle.html#r0">node</a>; }
998<a name="l01455"></a>01455     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a>&amp; ref ) { this-&gt;node = ref.<a class="code" href="classTiXmlHandle.html#r0">node</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
999<a name="l01456"></a>01456
1000<a name="l01458"></a>01458     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a3">FirstChild</a>() <span class="keyword">const</span>;
1001<a name="l01460"></a>01460     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a3">FirstChild</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>;
1002<a name="l01462"></a>01462     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a5">FirstChildElement</a>() <span class="keyword">const</span>;
1003<a name="l01464"></a>01464     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a5">FirstChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>;
1004<a name="l01465"></a>01465
1005<a name="l01469"></a>01469     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a7">Child</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* value, <span class="keywordtype">int</span> index ) <span class="keyword">const</span>;
1006<a name="l01473"></a>01473     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a7">Child</a>( <span class="keywordtype">int</span> index ) <span class="keyword">const</span>;
1007<a name="l01478"></a>01478     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a9">ChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* value, <span class="keywordtype">int</span> index ) <span class="keyword">const</span>;
1008<a name="l01483"></a>01483     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a9">ChildElement</a>( <span class="keywordtype">int</span> index ) <span class="keyword">const</span>;
1009<a name="l01484"></a>01484
1010<a name="l01485"></a>01485 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
1011<a name="l01486"></a>01486 <span class="preprocessor"></span>    <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a3">FirstChild</a>( <span class="keyword">const</span> std::string&amp; _value )<span class="keyword"> const               </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#a3">FirstChild</a>( _value.c_str() ); }
1012<a name="l01487"></a>01487     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a5">FirstChildElement</a>( <span class="keyword">const</span> std::string&amp; _value )<span class="keyword"> const        </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#a5">FirstChildElement</a>( _value.c_str() ); }
1013<a name="l01488"></a>01488
1014<a name="l01489"></a>01489     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a7">Child</a>( <span class="keyword">const</span> std::string&amp; _value, <span class="keywordtype">int</span> index )<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#a7">Child</a>( _value.c_str(), index ); }
1015<a name="l01490"></a>01490     <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a9">ChildElement</a>( <span class="keyword">const</span> std::string&amp; _value, <span class="keywordtype">int</span> index )<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#a9">ChildElement</a>( _value.c_str(), index ); }
1016<a name="l01491"></a>01491 <span class="preprocessor">    #endif</span>
1017<a name="l01492"></a>01492 <span class="preprocessor"></span>
1018<a name="l01494"></a><a class="code" href="classTiXmlHandle.html#a15">01494</a>     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlHandle.html#a15">Node</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> node; }
1019<a name="l01496"></a><a class="code" href="classTiXmlHandle.html#a16">01496</a>     <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlHandle.html#a16">Element</a>()<span class="keyword"> const   </span>{ <span class="keywordflow">return</span> ( ( node &amp;&amp; node-&gt;<a class="code" href="classTiXmlNode.html#a61">ToElement</a>() ) ? node-&gt;<a class="code" href="classTiXmlNode.html#a61">ToElement</a>() : 0 ); }
1020<a name="l01498"></a><a class="code" href="classTiXmlHandle.html#a17">01498</a>     <a class="code" href="classTiXmlText.html">TiXmlText</a>* <a class="code" href="classTiXmlHandle.html#a17">Text</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> ( ( node &amp;&amp; node-&gt;<a class="code" href="classTiXmlNode.html#a64">ToText</a>() ) ? node-&gt;<a class="code" href="classTiXmlNode.html#a64">ToText</a>() : 0 ); }
1021<a name="l01500"></a><a class="code" href="classTiXmlHandle.html#a18">01500</a>     <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>* <a class="code" href="classTiXmlHandle.html#a18">Unknown</a>()<span class="keyword"> const           </span>{ <span class="keywordflow">return</span> ( ( node &amp;&amp; node-&gt;<a class="code" href="classTiXmlNode.html#a63">ToUnknown</a>() ) ? node-&gt;<a class="code" href="classTiXmlNode.html#a63">ToUnknown</a>() : 0 ); }
1022<a name="l01501"></a>01501
1023<a name="l01502"></a>01502 <span class="keyword">private</span>:
1024<a name="l01503"></a>01503     <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* node;
1025<a name="l01504"></a>01504 };
1026<a name="l01505"></a>01505
1027<a name="l01506"></a>01506 <span class="preprocessor">#ifdef _MSC_VER</span>
1028<a name="l01507"></a>01507 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( pop )</span>
1029<a name="l01508"></a>01508 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
1030<a name="l01509"></a>01509 <span class="preprocessor"></span>
1031<a name="l01510"></a>01510 <span class="preprocessor">#endif</span>
1032<a name="l01511"></a>01511 <span class="preprocessor"></span>
1033</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sat Oct 8 14:15:30 2005 for TinyXml by&nbsp;
1034<a href="http://www.doxygen.org/index.html">
1035<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4 </small></address>
1036</body>
1037</html>
1038