24 #ifndef TINYXML2_INCLUDED 25 #define TINYXML2_INCLUDED 27 #if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) 56 #if defined( _DEBUG ) || defined (__DEBUG__) 57 # ifndef TINYXML2_DEBUG 58 # define TINYXML2_DEBUG 63 # pragma warning(push) 64 # pragma warning(disable: 4251) 69 # define TINYXML2_LIB // TODO? 71 # define TINYXML2_LIB __attribute__((visibility("hidden"))) 74 #if defined(TINYXML2_DEBUG) 75 # if defined(_MSC_VER) 76 # // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like 77 # define TIXMLASSERT( x ) if ( !((void)0,(x))) { __debugbreak(); } 78 # elif defined (ANDROID_NDK) 79 # include <android/log.h> 80 # define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); } 83 # define TIXMLASSERT assert 86 # define TIXMLASSERT( x ) {} 97 #define TINYXML2_MAJOR_VERSION 6 98 #define TINYXML2_MINOR_VERSION 2 99 #define TINYXML2_PATCH_VERSION 0 115 class XMLDeclaration;
144 void Set(
char* start,
char* end,
int flags ) {
161 _start =
const_cast<char*
>(str);
164 void SetStr(
const char* str,
int flags=0 );
166 char*
ParseText(
char* in,
const char* endTag,
int strFlags,
int* curLineNumPtr );
194 template <
class T,
int INITIAL_SIZE>
200 _allocated( INITIAL_SIZE ),
206 if ( _mem != _pool ) {
217 EnsureCapacity( _size+1 );
225 EnsureCapacity( _size+count );
226 T* ret = &_mem[_size];
258 return _mem[ _size - 1];
274 _mem[i] = _mem[_size - 1];
294 if ( cap > _allocated ) {
296 int newAllocated = cap * 2;
297 T* newMem =
new T[newAllocated];
299 memcpy( newMem, _mem,
sizeof(T)*_size );
300 if ( _mem != _pool ) {
304 _allocated = newAllocated;
309 T _pool[INITIAL_SIZE];
325 virtual int ItemSize()
const = 0;
326 virtual void* Alloc() = 0;
327 virtual void Free(
void* ) = 0;
328 virtual void SetTracked() = 0;
329 virtual void Clear() = 0;
336 template<
int ITEM_SIZE >
340 MemPoolT() : _blockPtrs(), _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {}
347 while( !_blockPtrs.Empty()) {
348 Block* lastBlock = _blockPtrs.Pop();
362 return _currentAllocs;
368 Block* block =
new Block();
369 _blockPtrs.Push( block );
371 Item* blockItems = block->items;
372 for(
int i = 0; i < ITEMS_PER_BLOCK - 1; ++i ) {
373 blockItems[i].next = &(blockItems[i + 1]);
375 blockItems[ITEMS_PER_BLOCK - 1].next = 0;
378 Item*
const result = _root;
383 if ( _currentAllocs > _maxAllocs ) {
384 _maxAllocs = _currentAllocs;
391 virtual void Free(
void* mem ) {
396 Item* item =
static_cast<Item*
>( mem );
397 #ifdef TINYXML2_DEBUG 398 memset( item, 0xfe,
sizeof( *item ) );
404 printf(
"Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n",
405 name, _maxAllocs, _maxAllocs * ITEM_SIZE / 1024, _currentAllocs,
406 ITEM_SIZE, _nAllocs, _blockPtrs.Size() );
428 enum { ITEMS_PER_BLOCK = (4 * 1024) / ITEM_SIZE };
436 char itemData[ITEM_SIZE];
549 while( IsWhiteSpace(*p) ) {
550 if (curLineNumPtr && *p ==
'\n') {
559 return const_cast<char*
>( SkipWhiteSpace( const_cast<const char*>(p), curLineNumPtr ) );
565 return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );
573 if ( isalpha( ch ) ) {
576 return ch ==
':' || ch ==
'_';
580 return IsNameStartChar( ch )
586 inline static bool StringEqual(
const char* p,
const char* q,
int nChar=INT_MAX ) {
593 return strncmp( p, q, nChar ) == 0;
597 return ( p & 0x80 ) != 0;
600 static const char* ReadBOM(
const char* p,
bool* hasBOM );
603 static const char* GetCharacterRef(
const char* p,
char* value,
int* length );
604 static void ConvertUTF32ToUTF8(
unsigned long input,
char* output,
int* length );
607 static void ToStr(
int v,
char*
buffer,
int bufferSize );
608 static void ToStr(
unsigned v,
char* buffer,
int bufferSize );
609 static void ToStr(
bool v,
char* buffer,
int bufferSize );
610 static void ToStr(
float v,
char* buffer,
int bufferSize );
611 static void ToStr(
double v,
char* buffer,
int bufferSize );
612 static void ToStr(int64_t v,
char* buffer,
int bufferSize);
615 static bool ToInt(
const char* str,
int* value );
616 static bool ToUnsigned(
const char* str,
unsigned* value );
617 static bool ToBool(
const char* str,
bool* value );
618 static bool ToFloat(
const char* str,
float* value );
619 static bool ToDouble(
const char* str,
double* value );
620 static bool ToInt64(
const char* str, int64_t* value);
627 static void SetBoolSerialization(
const char* writeTrue,
const char* writeFalse);
730 const char* Value()
const;
735 void SetValue(
const char* val,
bool staticMem=
false );
766 const XMLElement* FirstChildElement(
const char* name = 0 )
const;
769 return const_cast<XMLElement*
>(
const_cast<const XMLNode*
>(
this)->FirstChildElement( name ));
784 const XMLElement* LastChildElement(
const char* name = 0 )
const;
787 return const_cast<XMLElement*
>(
const_cast<const XMLNode*
>(
this)->LastChildElement(name) );
800 const XMLElement* PreviousSiblingElement(
const char* name = 0 )
const ;
803 return const_cast<XMLElement*
>(
const_cast<const XMLNode*
>(
this)->PreviousSiblingElement( name ) );
816 const XMLElement* NextSiblingElement(
const char* name = 0 )
const;
819 return const_cast<XMLElement*
>(
const_cast<const XMLNode*
>(
this)->NextSiblingElement( name ) );
832 return InsertEndChild( addThis );
855 void DeleteChildren();
860 void DeleteChild(
XMLNode* node );
894 virtual bool ShallowEqual(
const XMLNode* compare )
const = 0;
918 virtual bool Accept(
XMLVisitor* visitor )
const = 0;
938 virtual char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr);
956 static void DeleteNode(
XMLNode* node );
957 void InsertChildPreamble(
XMLNode* insertThis )
const;
958 const XMLElement* ToElementWithName(
const char* name )
const;
981 virtual bool Accept(
XMLVisitor* visitor )
const;
1000 virtual bool ShallowEqual(
const XMLNode* compare )
const;
1006 char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr );
1028 virtual bool Accept(
XMLVisitor* visitor )
const;
1031 virtual bool ShallowEqual(
const XMLNode* compare )
const;
1037 char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr);
1067 virtual bool Accept(
XMLVisitor* visitor )
const;
1070 virtual bool ShallowEqual(
const XMLNode* compare )
const;
1076 char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr );
1102 virtual bool Accept(
XMLVisitor* visitor )
const;
1105 virtual bool ShallowEqual(
const XMLNode* compare )
const;
1111 char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr );
1131 const char* Name()
const;
1134 const char* Value()
const;
1156 QueryInt64Value(&i);
1163 QueryUnsignedValue( &i );
1169 QueryBoolValue( &b );
1175 QueryDoubleValue( &d );
1181 QueryFloatValue( &f );
1189 XMLError QueryIntValue(
int* value )
const;
1191 XMLError QueryUnsignedValue(
unsigned int* value )
const;
1193 XMLError QueryInt64Value(int64_t* value)
const;
1195 XMLError QueryBoolValue(
bool* value )
const;
1197 XMLError QueryDoubleValue(
double* value )
const;
1199 XMLError QueryFloatValue(
float* value )
const;
1202 void SetAttribute(
const char* value );
1204 void SetAttribute(
int value );
1206 void SetAttribute(
unsigned value );
1208 void SetAttribute(int64_t value);
1210 void SetAttribute(
bool value );
1212 void SetAttribute(
double value );
1214 void SetAttribute(
float value );
1217 enum { BUF_SIZE = 200 };
1219 XMLAttribute() : _name(), _value(),_parseLineNum( 0 ), _next( 0 ), _memPool( 0 ) {}
1224 void SetName(
const char* name );
1226 char* ParseDeep(
char* p,
bool processEntities,
int* curLineNumPtr );
1249 void SetName(
const char* str,
bool staticMem=
false ) {
1250 SetValue( str, staticMem );
1259 virtual bool Accept(
XMLVisitor* visitor )
const;
1284 const char* Attribute(
const char* name,
const char* value=0 )
const;
1292 int IntAttribute(
const char* name,
int defaultValue = 0)
const;
1294 unsigned UnsignedAttribute(
const char* name,
unsigned defaultValue = 0)
const;
1296 int64_t Int64Attribute(
const char* name, int64_t defaultValue = 0)
const;
1298 bool BoolAttribute(
const char* name,
bool defaultValue =
false)
const;
1300 double DoubleAttribute(
const char* name,
double defaultValue = 0)
const;
1302 float FloatAttribute(
const char* name,
float defaultValue = 0)
const;
1374 *value = a->
Value();
1398 return QueryIntAttribute( name, value );
1402 return QueryUnsignedAttribute( name, value );
1406 return QueryInt64Attribute(name, value);
1410 return QueryBoolAttribute( name, value );
1414 return QueryDoubleAttribute( name, value );
1418 return QueryFloatAttribute( name, value );
1462 void DeleteAttribute(
const char* name );
1466 return _rootAttribute;
1469 const XMLAttribute* FindAttribute(
const char* name )
const;
1499 const char* GetText()
const;
1535 void SetText(
const char* inText );
1537 void SetText(
int value );
1539 void SetText(
unsigned value );
1541 void SetText(int64_t value);
1543 void SetText(
bool value );
1545 void SetText(
double value );
1547 void SetText(
float value );
1575 XMLError QueryIntText(
int* ival )
const;
1577 XMLError QueryUnsignedText(
unsigned* uval )
const;
1579 XMLError QueryInt64Text(int64_t* uval)
const;
1581 XMLError QueryBoolText(
bool* bval )
const;
1583 XMLError QueryDoubleText(
double* dval )
const;
1585 XMLError QueryFloatText(
float* fval )
const;
1587 int IntText(
int defaultValue = 0)
const;
1590 unsigned UnsignedText(
unsigned defaultValue = 0)
const;
1592 int64_t Int64Text(int64_t defaultValue = 0)
const;
1594 bool BoolText(
bool defaultValue =
false)
const;
1596 double DoubleText(
double defaultValue = 0)
const;
1598 float FloatText(
float defaultValue = 0)
const;
1607 return _closingType;
1610 virtual bool ShallowEqual(
const XMLNode* compare )
const;
1613 char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr );
1624 XMLAttribute* FindOrCreateAttribute(
const char* name );
1626 char* ParseAttributes(
char* p,
int* curLineNumPtr );
1627 static void DeleteAttribute(
XMLAttribute* attribute );
1630 enum { BUF_SIZE = 200 };
1684 XMLError Parse(
const char* xml,
size_t nBytes=(
size_t)(-1) );
1723 return _processEntities;
1726 return _whitespaceMode;
1745 return FirstChildElement();
1748 return FirstChildElement();
1766 virtual bool Accept(
XMLVisitor* visitor )
const;
1779 XMLComment* NewComment(
const char* comment );
1785 XMLText* NewText(
const char* text );
1809 void DeleteNode(
XMLNode* node );
1823 const char* ErrorName()
const;
1824 static const char* ErrorIDToName(
XMLError errorID);
1829 const char* ErrorStr()
const;
1832 void PrintError()
const;
1837 return _errorLineNum;
1853 char* Identify(
char* p,
XMLNode** node );
1895 void SetError(
XMLError error,
int lineNum,
const char* format, ... );
1903 this->_document = document;
1907 _document->PopDepth();
1915 template<
class NodeType,
int PoolElementSize>
1919 template<
class NodeType,
int PoolElementSize>
1926 returnNode->_memPool = &pool;
1928 _unlinked.Push(returnNode);
2007 return XMLHandle( _node ? _node->FirstChild() : 0 );
2011 return XMLHandle( _node ? _node->FirstChildElement( name ) : 0 );
2015 return XMLHandle( _node ? _node->LastChild() : 0 );
2019 return XMLHandle( _node ? _node->LastChildElement( name ) : 0 );
2023 return XMLHandle( _node ? _node->PreviousSibling() : 0 );
2027 return XMLHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );
2031 return XMLHandle( _node ? _node->NextSibling() : 0 );
2035 return XMLHandle( _node ? _node->NextSiblingElement( name ) : 0 );
2044 return ( _node ? _node->ToElement() : 0 );
2048 return ( _node ? _node->ToText() : 0 );
2052 return ( _node ? _node->ToUnknown() : 0 );
2056 return ( _node ? _node->ToDeclaration() : 0 );
2087 return XMLConstHandle( _node ? _node->FirstChildElement( name ) : 0 );
2093 return XMLConstHandle( _node ? _node->LastChildElement( name ) : 0 );
2099 return XMLConstHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );
2105 return XMLConstHandle( _node ? _node->NextSiblingElement( name ) : 0 );
2113 return ( _node ? _node->ToElement() : 0 );
2116 return ( _node ? _node->ToText() : 0 );
2119 return ( _node ? _node->ToUnknown() : 0 );
2122 return ( _node ? _node->ToDeclaration() : 0 );
2185 void PushHeader(
bool writeBOM,
bool writeDeclaration );
2189 void OpenElement(
const char* name,
bool compactMode=
false );
2191 void PushAttribute(
const char* name,
const char* value );
2192 void PushAttribute(
const char* name,
int value );
2193 void PushAttribute(
const char* name,
unsigned value );
2194 void PushAttribute(
const char* name, int64_t value);
2195 void PushAttribute(
const char* name,
bool value );
2196 void PushAttribute(
const char* name,
double value );
2198 virtual void CloseElement(
bool compactMode=
false );
2201 void PushText(
const char* text,
bool cdata=
false );
2203 void PushText(
int value );
2205 void PushText(
unsigned value );
2207 void PushText(int64_t value);
2209 void PushText(
bool value );
2211 void PushText(
float value );
2213 void PushText(
double value );
2216 void PushComment(
const char* comment );
2218 void PushDeclaration(
const char* value );
2219 void PushUnknown(
const char* value );
2227 virtual bool VisitExit(
const XMLElement& element );
2229 virtual bool Visit(
const XMLText& text );
2230 virtual bool Visit(
const XMLComment& comment );
2232 virtual bool Visit(
const XMLUnknown& unknown );
2239 return _buffer.Mem();
2247 return _buffer.Size();
2256 _firstElement =
true;
2265 virtual void PrintSpace(
int depth );
2266 void Print(
const char* format, ... );
2267 void Write(
const char*
data,
size_t size );
2268 inline void Write(
const char* data ) {
Write( data, strlen( data ) ); }
2269 void Putc(
char ch );
2271 void SealElementIfJustOpened();
2276 void PrintString(
const char*,
bool restrictedEntitySet );
2289 bool _entityFlag[ENTITY_RANGE];
2290 bool _restrictedEntityFlag[ENTITY_RANGE];
2302 #if defined(_MSC_VER) 2303 # pragma warning(pop) 2306 #endif // TINYXML2_INCLUDED virtual XMLElement * ToElement()
Safely cast to an Element, or null.
int QueryAttribute(const char *name, int *value) const
int QueryAttribute(const char *name, bool *value) const
const XMLDeclaration * ToDeclaration() const
void CollapseWhitespace()
const T * data(const std::vector< T, Alloc > &v)
bool BoolValue() const
Query as a boolean. See IntValue()
void SetAttribute(const char *name, int64_t value)
Sets the named attribute to value.
bool Error() const
Return true if there was an error parsing the document.
const XMLConstHandle FirstChild() const
const XMLConstHandle LastChild() const
XMLError QueryIntValue(int *value) const
const XMLText * ToText() const
static const int TIXML2_PATCH_VERSION
NodeType * CreateUnlinkedNode(MemPoolT< PoolElementSize > &pool)
XMLError QueryUnsignedAttribute(const char *name, unsigned int *value) const
See QueryIntAttribute()
virtual const XMLDeclaration * ToDeclaration() const
virtual XMLDocument * ToDocument()
Safely cast to a Document, or null.
XMLHandle(XMLNode *node)
Create a handle from any node (at any depth of the tree.) This can be a null pointer.
virtual const XMLComment * ToComment() const
XMLElement * PreviousSiblingElement(const char *name=0)
int CurrentAllocs() const
XMLError QueryFloatValue(float *value) const
See QueryIntValue.
const T & operator[](int i) const
static raw_event_t * buffer
XMLElement * LastChildElement(const char *name=0)
XMLAttribute * _rootAttribute
MemPoolT< sizeof(XMLAttribute) > _attributePool
ElementClosingType ClosingType() const
void SetAttribute(const char *name, unsigned value)
Sets the named attribute to value.
virtual XMLComment * ToComment()
Safely cast to a Comment, or null.
int GetLineNum() const
Gets the line number the node is in, if the document was parsed from a file.
XMLConstHandle & operator=(const XMLConstHandle &ref)
virtual const XMLText * ToText() const
XMLError QueryInt64Value(int64_t *value) const
See QueryIntValue.
virtual bool VisitEnter(const XMLElement &, const XMLAttribute *)
Visit an element.
static const char * SkipWhiteSpace(const char *p, int *curLineNumPtr)
bool CData() const
Returns true if this is a CDATA text element.
void Set(char *start, char *end, int flags)
static bool IsNameChar(unsigned char ch)
static bool IsWhiteSpace(char p)
void TransferTo(StrPair *other)
bool LoadFile(const char *name, bool binary, std::string *buf)
const XMLElement * RootElement() const
virtual XMLUnknown * ToUnknown()
Safely cast to an Unknown, or null.
virtual bool Visit(const XMLText &)
Visit a text node.
const XMLNode * FirstChild() const
Get the first child node, or null if none exists.
DepthTracker(XMLDocument *document)
virtual bool ShallowEqual(const XMLNode *) const
static char * SkipWhiteSpace(char *p, int *curLineNumPtr)
double DoubleValue() const
Query as a double. See IntValue()
XMLConstHandle(const XMLNode *node)
XMLNode * PreviousSibling()
virtual bool VisitExit(const XMLDocument &)
Visit a document.
char * ParseName(char *in)
const T & PeekTop() const
const char * Value() const
The value of the attribute.
XMLConstHandle(const XMLNode &node)
int QueryAttribute(const char *name, double *value) const
void SetAttribute(const char *value)
Set the attribute to a string value.
virtual const XMLText * ToText() const
XMLError QueryFloatAttribute(const char *name, float *value) const
See QueryIntAttribute()
virtual const XMLUnknown * ToUnknown() const
const XMLNode * ToNode() const
const XMLConstHandle PreviousSibling() const
virtual XMLText * ToText()
Safely cast to Text, or null.
virtual bool Visit(const XMLComment &)
Visit a comment node.
XMLHandle LastChild()
Get the last child of this handle.
void Write(const char *data)
static const char * writeBoolTrue
virtual XMLNode * ShallowClone(XMLDocument *) const
void SetAttribute(const char *name, const char *value)
Sets the named attribute to value.
XMLHandle FirstChildElement(const char *name=0)
Get the first child element of this handle.
static const int TIXML2_MINOR_VERSION
const XMLUnknown * ToUnknown() const
XMLHandle & operator=(const XMLHandle &ref)
Assignment.
const XMLConstHandle NextSibling() const
XMLError QueryDoubleValue(double *value) const
See QueryIntValue.
XMLError QueryInt64Attribute(const char *name, int64_t *value) const
See QueryIntAttribute()
bool ProcessEntities() const
DynArray< char, 20 > _buffer
XMLError ErrorID() const
Return the errorID.
XMLElement * RootElement()
XMLHandle NextSiblingElement(const char *name=0)
Get the next sibling element of this handle.
static bool IsUTF8Continuation(char p)
const XMLNode * Parent() const
Get the parent of this node on the DOM.
const XMLAttribute * Next() const
The next attribute in the list.
XMLError QueryDoubleAttribute(const char *name, double *value) const
See QueryIntAttribute()
void SetName(const char *str, bool staticMem=false)
Set the name of the element.
void SetAttribute(const char *name, double value)
Sets the named attribute to value.
int QueryAttribute(const char *name, float *value) const
const XMLConstHandle PreviousSiblingElement(const char *name=0) const
static const int TIXML2_MAJOR_VERSION
MemPoolT< sizeof(XMLComment) > _commentPool
void * GetUserData() const
XMLHandle LastChildElement(const char *name=0)
Get the last child element of this handle.
void EnsureCapacity(int cap)
virtual bool VisitExit(const XMLDocument &)
Visit a document.
void SetStr(const char *str, int flags=0)
XMLHandle(XMLNode &node)
Create a handle from a node.
void SetCData(bool isCData)
Declare whether this should be CDATA or standard text.
XMLDocument * GetDocument()
Get the XMLDocument that owns this XMLNode.
char * ParseText(char *in, const char *endTag, int strFlags, int *curLineNumPtr)
const XMLDocument * GetDocument() const
Get the XMLDocument that owns this XMLNode.
virtual XMLDeclaration * ToDeclaration()
Safely cast to a Declaration, or null.
virtual XMLUnknown * ToUnknown()
Safely cast to an Unknown, or null.
ElementClosingType _closingType
int ErrorLineNum() const
Return the line where the error occured, or zero if unknown.
static bool StringEqual(const char *p, const char *q, int nChar=INT_MAX)
int64_t Int64Value() const
virtual bool VisitExit(const XMLElement &)
Visit an element.
int QueryAttribute(const char *name, int64_t *value) const
virtual const XMLElement * ToElement() const
virtual bool Visit(const XMLUnknown &)
Visit an unknown node.
XMLConstHandle(const XMLConstHandle &ref)
XMLElement * NextSiblingElement(const char *name=0)
const XMLNode * PreviousSibling() const
Get the previous (left) sibling node of this node.
virtual const XMLDeclaration * ToDeclaration() const
XMLNode * LinkEndChild(XMLNode *addThis)
XMLAttribute * FindAttribute(const char *name)
XMLElement * FirstChildElement(const char *name=0)
void SetAttribute(const char *name, bool value)
Sets the named attribute to value.
void SetAttribute(const char *name, float value)
Sets the named attribute to value.
static volatile int count
XMLError QueryStringAttribute(const char *name, const char **value) const
See QueryIntAttribute()
const XMLConstHandle FirstChildElement(const char *name=0) const
DynArray< const char *, 10 > _stack
XMLError QueryIntAttribute(const char *name, int *value) const
XMLNode * ToNode()
Safe cast to XMLNode. This can return null.
void SetUserData(void *userData)
XMLHandle NextSibling()
Get the next sibling of this handle.
unsigned UnsignedValue() const
Query as an unsigned integer. See IntValue()
DynArray< XMLNode *, 10 > _unlinked
DynArray< Block *, 10 > _blockPtrs
XMLError QueryUnsignedValue(unsigned int *value) const
See QueryIntValue.
XMLText(XMLDocument *doc)
static bool IsNameStartChar(unsigned char ch)
const XMLElement * ToElement() const
virtual XMLText * ToText()
Safely cast to Text, or null.
int GetLineNum() const
Gets the line number the attribute is in, if the document was parsed from a file. ...
void SetAttribute(const char *name, int value)
Sets the named attribute to value.
XMLError QueryBoolAttribute(const char *name, bool *value) const
See QueryIntAttribute()
virtual void Free(void *mem)
XMLText * ToText()
Safe cast to XMLText. This can return null.
void operator=(StrPair &other)
int QueryAttribute(const char *name, unsigned int *value) const
const XMLNode * LastChild() const
Get the last child node, or null if none exists.
const XMLConstHandle LastChildElement(const char *name=0) const
const XMLConstHandle NextSiblingElement(const char *name=0) const
virtual bool CompactMode(const XMLElement &)
XMLHandle PreviousSibling()
Get the previous sibling of this handle.
MemPoolT< sizeof(XMLText) > _textPool
XMLDeclaration * ToDeclaration()
Safe cast to XMLDeclaration. This can return null.
bool NoChildren() const
Returns true if this node has no children.
virtual const XMLDocument * ToDocument() const
MemPoolT< sizeof(XMLElement) > _elementPool
const XMLAttribute * FirstAttribute() const
Return the first attribute in the list.
virtual int ItemSize() const
XMLUnknown * ToUnknown()
Safe cast to XMLUnknown. This can return null.
static const char * writeBoolFalse
XMLHandle FirstChild()
Get the first child of this handle.
virtual const XMLUnknown * ToUnknown() const
XMLElement * ToElement()
Safe cast to XMLElement. This can return null.
XMLHandle PreviousSiblingElement(const char *name=0)
Get the previous sibling element of this handle.
virtual bool Visit(const XMLDeclaration &)
Visit a declaration.
Whitespace _whitespaceMode
virtual bool VisitEnter(const XMLDocument &)
Visit a document.
virtual const XMLElement * ToElement() const
XMLError QueryBoolValue(bool *value) const
See QueryIntValue.
virtual XMLDocument * ToDocument()
Safely cast to a Document, or null.
Whitespace WhitespaceMode() const
float FloatValue() const
Query as a float. See IntValue()
virtual XMLDeclaration * ToDeclaration()
Safely cast to a Declaration, or null.
virtual XMLElement * ToElement()
Safely cast to an Element, or null.
void Trace(const char *name)
const XMLNode * NextSibling() const
Get the next (right) sibling node of this node.
static const int TINYXML2_MAX_ELEMENT_DEPTH
XMLHandle(const XMLHandle &ref)
Copy constructor.
virtual const XMLDocument * ToDocument() const
bool SaveFile(const char *name, const char *buf, size_t len, bool binary)
const char * CStr() const
const char * Name() const
Get the name of an element (which is the Value() of the node.)
void SetInternedStr(const char *str)