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
64# pragma warning(disable: 4251)
68# ifdef TINYXML2_EXPORT
69# define TINYXML2_LIB __declspec(dllexport)
70# elif defined(TINYXML2_IMPORT)
71# define TINYXML2_LIB __declspec(dllimport)
76# define TINYXML2_LIB __attribute__((visibility("default")))
82#if !defined(TIXMLASSERT)
83#if defined(TINYXML2_DEBUG)
86# define TIXMLASSERT( x ) if ( !((void)0,(x))) { __debugbreak(); }
87# elif defined (ANDROID_NDK)
88# include <android/log.h>
89# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }
92# define TIXMLASSERT assert
95# define TIXMLASSERT( x ) {}
106#define TINYXML2_MAJOR_VERSION 8
107#define TINYXML2_MINOR_VERSION 0
108#define TINYXML2_PATCH_VERSION 0
140 NEEDS_ENTITY_PROCESSING = 0x01,
141 NEEDS_NEWLINE_NORMALIZATION = 0x02,
142 NEEDS_WHITESPACE_COLLAPSING = 0x04,
144 TEXT_ELEMENT = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,
145 TEXT_ELEMENT_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION,
147 ATTRIBUTE_VALUE = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,
148 ATTRIBUTE_VALUE_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION,
149 COMMENT = NEEDS_NEWLINE_NORMALIZATION
152 StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {}
155 void Set(
char* start,
char* end,
int flags ) {
161 _flags = flags | NEEDS_FLUSH;
164 const char* GetStr();
167 return _start == _end;
172 _start =
const_cast<char*
>(str);
175 void SetStr(
const char* str,
int flags=0 );
177 char* ParseText(
char* in,
const char* endTag,
int strFlags,
int* curLineNumPtr );
178 char* ParseName(
char* in );
180 void TransferTo(
StrPair* other );
184 void CollapseWhitespace();
205template <
class T,
int INITIAL_SIZE>
307 const int newAllocated = cap * 2;
308 T* newMem =
new T[newAllocated];
338 virtual void Free(
void* ) = 0;
346template<
int ITEM_SIZE >
383 blockItems[i].
next = &(blockItems[i + 1]);
401 virtual void Free(
void* mem ) {
406 Item* item =
static_cast<Item*
>( mem );
408 memset( item, 0xfe,
sizeof( *item ) );
414 printf(
"Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n",
557 while( IsWhiteSpace(*p) ) {
558 if (curLineNumPtr && *p ==
'\n') {
567 return const_cast<char*
>( SkipWhiteSpace(
const_cast<const char*
>(p), curLineNumPtr ) );
573 return !IsUTF8Continuation(p) && isspace(
static_cast<unsigned char>(p) );
581 if ( isalpha( ch ) ) {
584 return ch ==
':' || ch ==
'_';
588 return IsNameStartChar( ch )
595 p = SkipWhiteSpace(p, 0);
596 return p && *p ==
'0' && ( *(p + 1) ==
'x' || *(p + 1) ==
'X');
599 inline static bool StringEqual(
const char* p,
const char* q,
int nChar=INT_MAX ) {
606 return strncmp( p, q, nChar ) == 0;
610 return ( p & 0x80 ) != 0;
613 static const char* ReadBOM(
const char* p,
bool* hasBOM );
616 static const char* GetCharacterRef(
const char* p,
char* value,
int* length );
617 static void ConvertUTF32ToUTF8(
unsigned long input,
char* output,
int* length );
620 static void ToStr(
int v,
char* buffer,
int bufferSize );
621 static void ToStr(
unsigned v,
char* buffer,
int bufferSize );
622 static void ToStr(
bool v,
char* buffer,
int bufferSize );
623 static void ToStr(
float v,
char* buffer,
int bufferSize );
624 static void ToStr(
double v,
char* buffer,
int bufferSize );
625 static void ToStr(int64_t v,
char* buffer,
int bufferSize);
626 static void ToStr(uint64_t v,
char* buffer,
int bufferSize);
629 static bool ToInt(
const char* str,
int* value );
630 static bool ToUnsigned(
const char* str,
unsigned* value );
631 static bool ToBool(
const char* str,
bool* value );
632 static bool ToFloat(
const char* str,
float* value );
633 static bool ToDouble(
const char* str,
double* value );
634 static bool ToInt64(
const char* str, int64_t* value);
635 static bool ToUnsigned64(
const char* str, uint64_t* value);
641 static void SetBoolSerialization(
const char* writeTrue,
const char* writeFalse);
744 const char* Value()
const;
749 void SetValue(
const char* val,
bool staticMem=
false );
780 const XMLElement* FirstChildElement(
const char*
name = 0 )
const;
814 const XMLElement* PreviousSiblingElement(
const char*
name = 0 )
const ;
830 const XMLElement* NextSiblingElement(
const char*
name = 0 )
const;
846 return InsertEndChild( addThis );
869 void DeleteChildren();
874 void DeleteChild(
XMLNode* node );
952 virtual char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr);
970 static void DeleteNode(
XMLNode* node );
971 void InsertChildPreamble(
XMLNode* insertThis )
const;
995 virtual bool Accept(
XMLVisitor* visitor )
const;
1020 char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr );
1042 virtual bool Accept(
XMLVisitor* visitor )
const;
1051 char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr);
1081 virtual bool Accept(
XMLVisitor* visitor )
const;
1090 char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr );
1116 virtual bool Accept(
XMLVisitor* visitor )
const;
1125 char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr );
1145 const char* Name()
const;
1148 const char* Value()
const;
1170 QueryInt64Value(&i);
1176 QueryUnsigned64Value(&i);
1183 QueryUnsignedValue( &i );
1189 QueryBoolValue( &b );
1195 QueryDoubleValue( &d );
1201 QueryFloatValue( &f );
1209 XMLError QueryIntValue(
int* value )
const;
1211 XMLError QueryUnsignedValue(
unsigned int* value )
const;
1213 XMLError QueryInt64Value(int64_t* value)
const;
1215 XMLError QueryUnsigned64Value(uint64_t* value)
const;
1217 XMLError QueryBoolValue(
bool* value )
const;
1219 XMLError QueryDoubleValue(
double* value )
const;
1221 XMLError QueryFloatValue(
float* value )
const;
1224 void SetAttribute(
const char* value );
1226 void SetAttribute(
int value );
1228 void SetAttribute(
unsigned value );
1230 void SetAttribute(int64_t value);
1232 void SetAttribute(uint64_t value);
1234 void SetAttribute(
bool value );
1236 void SetAttribute(
double value );
1238 void SetAttribute(
float value );
1241 enum { BUF_SIZE = 200 };
1243 XMLAttribute() : _name(), _value(),_parseLineNum( 0 ), _next( 0 ), _memPool( 0 ) {}
1248 void SetName(
const char*
name );
1250 char* ParseDeep(
char* p,
bool processEntities,
int* curLineNumPtr );
1273 void SetName(
const char* str,
bool staticMem=
false ) {
1274 SetValue( str, staticMem );
1283 virtual bool Accept(
XMLVisitor* visitor )
const;
1308 const char* Attribute(
const char*
name,
const char* value=0 )
const;
1316 int IntAttribute(
const char*
name,
int defaultValue = 0)
const;
1318 unsigned UnsignedAttribute(
const char*
name,
unsigned defaultValue = 0)
const;
1320 int64_t Int64Attribute(
const char*
name, int64_t defaultValue = 0)
const;
1322 uint64_t Unsigned64Attribute(
const char*
name, uint64_t defaultValue = 0)
const;
1324 bool BoolAttribute(
const char*
name,
bool defaultValue =
false)
const;
1326 double DoubleAttribute(
const char*
name,
double defaultValue = 0)
const;
1328 float FloatAttribute(
const char*
name,
float defaultValue = 0)
const;
1409 *value = a->
Value();
1433 return QueryIntAttribute(
name, value );
1437 return QueryUnsignedAttribute(
name, value );
1441 return QueryInt64Attribute(
name, value);
1445 return QueryUnsigned64Attribute(
name, value);
1449 return QueryBoolAttribute(
name, value );
1453 return QueryDoubleAttribute(
name, value );
1457 return QueryFloatAttribute(
name, value );
1461 return QueryStringAttribute(
name, value);
1511 void DeleteAttribute(
const char*
name );
1515 return _rootAttribute;
1548 const char* GetText()
const;
1584 void SetText(
const char* inText );
1586 void SetText(
int value );
1588 void SetText(
unsigned value );
1590 void SetText(int64_t value);
1592 void SetText(uint64_t value);
1594 void SetText(
bool value );
1596 void SetText(
double value );
1598 void SetText(
float value );
1626 XMLError QueryIntText(
int* ival )
const;
1628 XMLError QueryUnsignedText(
unsigned* uval )
const;
1630 XMLError QueryInt64Text(int64_t* uval)
const;
1632 XMLError QueryUnsigned64Text(uint64_t* uval)
const;
1634 XMLError QueryBoolText(
bool* bval )
const;
1636 XMLError QueryDoubleText(
double* dval )
const;
1638 XMLError QueryFloatText(
float* fval )
const;
1640 int IntText(
int defaultValue = 0)
const;
1643 unsigned UnsignedText(
unsigned defaultValue = 0)
const;
1645 int64_t Int64Text(int64_t defaultValue = 0)
const;
1647 uint64_t Unsigned64Text(uint64_t defaultValue = 0)
const;
1649 bool BoolText(
bool defaultValue =
false)
const;
1651 double DoubleText(
double defaultValue = 0)
const;
1653 float FloatText(
float defaultValue = 0)
const;
1661 XMLComment* InsertNewComment(
const char* comment);
1663 XMLText* InsertNewText(
const char* text);
1667 XMLUnknown* InsertNewUnknown(
const char* text);
1677 return _closingType;
1683 char* ParseDeep(
char* p,
StrPair* parentEndTag,
int* curLineNumPtr );
1692 char* ParseAttributes(
char* p,
int* curLineNumPtr );
1693 static void DeleteAttribute(
XMLAttribute* attribute );
1696 enum { BUF_SIZE = 200 };
1750 XMLError Parse(
const char* xml,
size_t nBytes=
static_cast<size_t>(-1) );
1757 XMLError LoadFile(
const char* filename );
1777 XMLError SaveFile(
const char* filename,
bool compact =
false );
1786 XMLError SaveFile( FILE* fp,
bool compact =
false );
1789 return _processEntities;
1792 return _whitespaceMode;
1811 return FirstChildElement();
1814 return FirstChildElement();
1832 virtual bool Accept(
XMLVisitor* visitor )
const;
1845 XMLComment* NewComment(
const char* comment );
1851 XMLText* NewText(
const char* text );
1875 void DeleteNode(
XMLNode* node );
1888 const char* ErrorName()
const;
1889 static const char* ErrorIDToName(
XMLError errorID);
1894 const char* ErrorStr()
const;
1897 void PrintError()
const;
1902 return _errorLineNum;
1918 char* Identify(
char* p,
XMLNode** node );
1921 void MarkInUse(
const XMLNode*
const);
1960 void SetError(
XMLError error,
int lineNum,
const char*
format, ... );
1968 this->_document = document;
1972 _document->PopDepth();
1980 template<
class NodeType,
int PoolElementSize>
1984template<
class NodeType,
int PoolElementSize>
1987 TIXMLASSERT(
sizeof( NodeType ) == PoolElementSize );
1989 NodeType* returnNode =
new (pool.
Alloc()) NodeType(
this );
1991 returnNode->_memPool = &pool;
2072 return XMLHandle( _node ? _node->FirstChild() : 0 );
2076 return XMLHandle( _node ? _node->FirstChildElement(
name ) : 0 );
2080 return XMLHandle( _node ? _node->LastChild() : 0 );
2084 return XMLHandle( _node ? _node->LastChildElement(
name ) : 0 );
2088 return XMLHandle( _node ? _node->PreviousSibling() : 0 );
2092 return XMLHandle( _node ? _node->PreviousSiblingElement(
name ) : 0 );
2096 return XMLHandle( _node ? _node->NextSibling() : 0 );
2100 return XMLHandle( _node ? _node->NextSiblingElement(
name ) : 0 );
2109 return ( _node ? _node->ToElement() : 0 );
2113 return ( _node ? _node->ToText() : 0 );
2117 return ( _node ? _node->ToUnknown() : 0 );
2121 return ( _node ? _node->ToDeclaration() : 0 );
2178 return ( _node ? _node->ToElement() : 0 );
2181 return ( _node ? _node->ToText() : 0 );
2184 return ( _node ? _node->ToUnknown() : 0 );
2187 return ( _node ? _node->ToDeclaration() : 0 );
2246 XMLPrinter( FILE* file=0,
bool compact =
false,
int depth = 0 );
2250 void PushHeader(
bool writeBOM,
bool writeDeclaration );
2254 void OpenElement(
const char*
name,
bool compactMode=
false );
2256 void PushAttribute(
const char*
name,
const char* value );
2257 void PushAttribute(
const char*
name,
int value );
2258 void PushAttribute(
const char*
name,
unsigned value );
2259 void PushAttribute(
const char*
name, int64_t value );
2260 void PushAttribute(
const char*
name, uint64_t value );
2261 void PushAttribute(
const char*
name,
bool value );
2262 void PushAttribute(
const char*
name,
double value );
2264 virtual void CloseElement(
bool compactMode=
false );
2267 void PushText(
const char* text,
bool cdata=
false );
2269 void PushText(
int value );
2271 void PushText(
unsigned value );
2273 void PushText( int64_t value );
2275 void PushText( uint64_t value );
2277 void PushText(
bool value );
2279 void PushText(
float value );
2281 void PushText(
double value );
2284 void PushComment(
const char* comment );
2286 void PushDeclaration(
const char* value );
2287 void PushUnknown(
const char* value );
2295 virtual bool VisitExit(
const XMLElement& element );
2297 virtual bool Visit(
const XMLText& text );
2298 virtual bool Visit(
const XMLComment& comment );
2300 virtual bool Visit(
const XMLUnknown& unknown );
2307 return _buffer.Mem();
2315 return _buffer.Size();
2324 _firstElement = resetToFirstElement;
2333 virtual void PrintSpace(
int depth );
2334 virtual void Print(
const char*
format, ... );
2335 virtual void Write(
const char* data,
size_t size );
2336 virtual void Putc(
char ch );
2338 inline void Write(
const char* data) {
Write(data, strlen(data)); }
2340 void SealElementIfJustOpened();
2349 void PrepareForNewNode(
bool compactMode );
2350 void PrintString(
const char*,
bool restrictedEntitySet );
2363 bool _entityFlag[ENTITY_RANGE];
2364 bool _restrictedEntityFlag[ENTITY_RANGE];
2376#if defined(_MSC_VER)
2377# pragma warning(pop)
void EnsureCapacity(int cap)
const T & PeekTop() const
void operator=(const DynArray &)
const T & operator[](int i) const
DynArray(const DynArray &)
virtual int ItemSize() const =0
virtual void Free(void *)=0
virtual void SetTracked()=0
DynArray< Block *, 10 > _blockPtrs
void operator=(const MemPoolT &)
virtual void Free(void *mem)
int CurrentAllocs() const
void Trace(const char *name)
virtual int ItemSize() const
MemPoolT(const MemPoolT &)
void SetInternedStr(const char *str)
void Set(char *start, char *end, int flags)
void operator=(const StrPair &other)
StrPair(const StrPair &other)
int GetLineNum() const
Gets the line number the attribute is in, if the document was parsed from a file.
XMLError QueryFloatValue(float *value) const
See QueryIntValue.
unsigned UnsignedValue() const
Query as an unsigned integer. See IntValue()
float FloatValue() const
Query as a float. See IntValue()
XMLError QueryDoubleValue(double *value) const
See QueryIntValue.
void operator=(const XMLAttribute &)
void SetAttribute(const char *value)
Set the attribute to a string value.
XMLAttribute(const XMLAttribute &)
XMLError QueryUnsignedValue(unsigned int *value) const
See QueryIntValue.
double DoubleValue() const
Query as a double. See IntValue()
XMLError QueryInt64Value(int64_t *value) const
See QueryIntValue.
XMLError QueryBoolValue(bool *value) const
See QueryIntValue.
XMLError QueryIntValue(int *value) const
int64_t Int64Value() const
bool BoolValue() const
Query as a boolean. See IntValue()
const XMLAttribute * Next() const
The next attribute in the list.
const char * Value() const
The value of the attribute.
uint64_t Unsigned64Value() const
XMLError QueryUnsigned64Value(uint64_t *value) const
See QueryIntValue.
XMLConstHandle(const XMLNode *node)
const XMLText * ToText() const
XMLConstHandle & operator=(const XMLConstHandle &ref)
const XMLConstHandle NextSiblingElement(const char *name=0) const
const XMLElement * ToElement() const
XMLConstHandle(const XMLConstHandle &ref)
const XMLUnknown * ToUnknown() const
const XMLDeclaration * ToDeclaration() const
XMLConstHandle(const XMLNode &node)
const XMLConstHandle LastChild() const
const XMLConstHandle LastChildElement(const char *name=0) const
const XMLConstHandle FirstChildElement(const char *name=0) const
const XMLNode * ToNode() const
const XMLConstHandle PreviousSibling() const
const XMLConstHandle NextSibling() const
const XMLConstHandle FirstChild() const
const XMLConstHandle PreviousSiblingElement(const char *name=0) const
XMLDeclaration & operator=(const XMLDeclaration &)
XMLDeclaration(const XMLDeclaration &)
virtual const XMLDeclaration * ToDeclaration() const
virtual XMLDeclaration * ToDeclaration()
Safely cast to a Declaration, or null.
DepthTracker(XMLDocument *document)
XMLElement * RootElement()
DynArray< XMLNode *, 10 > _unlinked
bool Error() const
Return true if there was an error parsing the document.
const XMLElement * RootElement() const
bool ProcessEntities() const
int ErrorLineNum() const
Return the line where the error occurred, or zero if unknown.
virtual bool ShallowEqual(const XMLNode *) const
Whitespace WhitespaceMode() const
virtual XMLDocument * ToDocument()
Safely cast to a Document, or null.
void operator=(const XMLDocument &)
virtual const XMLDocument * ToDocument() const
NodeType * CreateUnlinkedNode(MemPoolT< PoolElementSize > &pool)
XMLDocument(const XMLDocument &)
virtual XMLNode * ShallowClone(XMLDocument *) const
XMLError ErrorID() const
Return the errorID.
Whitespace _whitespaceMode
void SetAttribute(const char *name, const char *value)
Sets the named attribute to value.
XMLError QueryUnsigned64Attribute(const char *name, uint64_t *value) const
See QueryIntAttribute()
XMLError QueryBoolAttribute(const char *name, bool *value) const
See QueryIntAttribute()
XMLError QueryAttribute(const char *name, bool *value) const
XMLElement(const XMLElement &)
void SetAttribute(const char *name, double value)
Sets the named attribute to value.
XMLError QueryUnsignedAttribute(const char *name, unsigned int *value) const
See QueryIntAttribute()
ElementClosingType _closingType
XMLError QueryAttribute(const char *name, unsigned int *value) const
XMLError QueryAttribute(const char *name, int64_t *value) const
const XMLAttribute * FirstAttribute() const
Return the first attribute in the list.
XMLError QueryAttribute(const char *name, double *value) const
void SetAttribute(const char *name, float value)
Sets the named attribute to value.
XMLError QueryAttribute(const char *name, int *value) const
XMLError QueryDoubleAttribute(const char *name, double *value) const
See QueryIntAttribute()
ElementClosingType ClosingType() const
XMLError QueryInt64Attribute(const char *name, int64_t *value) const
See QueryIntAttribute()
XMLError QueryIntAttribute(const char *name, int *value) const
void SetName(const char *str, bool staticMem=false)
Set the name of the element.
virtual const XMLElement * ToElement() const
void SetAttribute(const char *name, bool value)
Sets the named attribute to value.
void SetAttribute(const char *name, int value)
Sets the named attribute to value.
void SetAttribute(const char *name, int64_t value)
Sets the named attribute to value.
virtual XMLElement * ToElement()
Safely cast to an Element, or null.
const char * Name() const
Get the name of an element (which is the Value() of the node.)
XMLError QueryAttribute(const char *name, float *value) const
XMLError QueryFloatAttribute(const char *name, float *value) const
See QueryIntAttribute()
XMLAttribute * _rootAttribute
XMLError QueryAttribute(const char *name, uint64_t *value) const
void SetAttribute(const char *name, uint64_t value)
Sets the named attribute to value.
XMLError QueryStringAttribute(const char *name, const char **value) const
See QueryIntAttribute()
void SetAttribute(const char *name, unsigned value)
Sets the named attribute to value.
void operator=(const XMLElement &)
XMLError QueryAttribute(const char *name, const char **value) const
XMLHandle PreviousSibling()
Get the previous sibling of this handle.
XMLHandle LastChildElement(const char *name=0)
Get the last child element of this handle.
XMLHandle FirstChild()
Get the first child of this handle.
XMLNode * ToNode()
Safe cast to XMLNode. This can return null.
XMLHandle FirstChildElement(const char *name=0)
Get the first child element of this handle.
XMLHandle PreviousSiblingElement(const char *name=0)
Get the previous sibling element of this handle.
XMLDeclaration * ToDeclaration()
Safe cast to XMLDeclaration. This can return null.
XMLHandle(XMLNode *node)
Create a handle from any node (at any depth of the tree.) This can be a null pointer.
XMLHandle LastChild()
Get the last child of this handle.
XMLHandle & operator=(const XMLHandle &ref)
Assignment.
XMLHandle(XMLNode &node)
Create a handle from a node.
XMLHandle NextSibling()
Get the next sibling of this handle.
XMLElement * ToElement()
Safe cast to XMLElement. This can return null.
XMLText * ToText()
Safe cast to XMLText. This can return null.
XMLUnknown * ToUnknown()
Safe cast to XMLUnknown. This can return null.
XMLHandle NextSiblingElement(const char *name=0)
Get the next sibling element of this handle.
XMLHandle(const XMLHandle &ref)
Copy constructor.
void SetUserData(void *userData)
virtual const XMLText * ToText() const
virtual XMLText * ToText()
Safely cast to Text, or null.
virtual XMLDeclaration * ToDeclaration()
Safely cast to a Declaration, or null.
void * GetUserData() const
XMLElement * FirstChildElement(const char *name=0)
XMLDocument * GetDocument()
Get the XMLDocument that owns this XMLNode.
XMLElement * LastChildElement(const char *name=0)
const XMLNode * Parent() const
Get the parent of this node on the DOM.
XMLNode & operator=(const XMLNode &)
XMLNode * PreviousSibling()
virtual XMLComment * ToComment()
Safely cast to a Comment, or null.
virtual XMLDocument * ToDocument()
Safely cast to a Document, or null.
const XMLNode * LastChild() const
Get the last child node, or null if none exists.
const XMLDocument * GetDocument() const
Get the XMLDocument that owns this XMLNode.
virtual const XMLElement * ToElement() const
virtual bool ShallowEqual(const XMLNode *compare) const =0
virtual bool Accept(XMLVisitor *visitor) const =0
XMLElement * NextSiblingElement(const char *name=0)
virtual XMLNode * ShallowClone(XMLDocument *document) const =0
const XMLNode * PreviousSibling() const
Get the previous (left) sibling node of this node.
virtual const XMLDeclaration * ToDeclaration() const
virtual XMLElement * ToElement()
Safely cast to an Element, or null.
int GetLineNum() const
Gets the line number the node is in, if the document was parsed from a file.
virtual XMLUnknown * ToUnknown()
Safely cast to an Unknown, or null.
virtual const XMLUnknown * ToUnknown() const
const XMLNode * FirstChild() const
Get the first child node, or null if none exists.
XMLElement * PreviousSiblingElement(const char *name=0)
bool NoChildren() const
Returns true if this node has no children.
virtual const XMLDocument * ToDocument() const
XMLNode * LinkEndChild(XMLNode *addThis)
virtual const XMLComment * ToComment() const
const XMLNode * NextSibling() const
Get the next (right) sibling node of this node.
XMLPrinter(const XMLPrinter &)
virtual bool VisitExit(const XMLDocument &)
Visit a document.
DynArray< char, 20 > _buffer
virtual bool CompactMode(const XMLElement &)
void Write(const char *data)
void ClearBuffer(bool resetToFirstElement=true)
DynArray< const char *, 10 > _stack
const char * CStr() const
XMLPrinter & operator=(const XMLPrinter &)
virtual const XMLText * ToText() const
virtual XMLText * ToText()
Safely cast to Text, or null.
XMLText & operator=(const XMLText &)
bool CData() const
Returns true if this is a CDATA text element.
void SetCData(bool isCData)
Declare whether this should be CDATA or standard text.
XMLText(XMLDocument *doc)
virtual XMLUnknown * ToUnknown()
Safely cast to an Unknown, or null.
XMLUnknown(const XMLUnknown &)
virtual const XMLUnknown * ToUnknown() const
XMLUnknown & operator=(const XMLUnknown &)
static bool IsNameChar(unsigned char ch)
static bool IsPrefixHex(const char *p)
static bool IsWhiteSpace(char p)
static bool IsUTF8Continuation(const char p)
static const char * writeBoolTrue
static bool IsNameStartChar(unsigned char ch)
static const char * SkipWhiteSpace(const char *p, int *curLineNumPtr)
static bool StringEqual(const char *p, const char *q, int nChar=INT_MAX)
static const char * writeBoolFalse
static char * SkipWhiteSpace(char *const p, int *curLineNumPtr)
virtual bool Visit(const XMLUnknown &)
Visit an unknown node.
virtual bool VisitExit(const XMLDocument &)
Visit a document.
virtual bool VisitExit(const XMLElement &)
Visit an element.
virtual bool VisitEnter(const XMLDocument &)
Visit a document.
virtual bool Visit(const XMLComment &)
Visit a comment node.
virtual bool Visit(const XMLDeclaration &)
Visit a declaration.
virtual bool Visit(const XMLText &)
Visit a text node.
virtual bool VisitEnter(const XMLElement &, const XMLAttribute *)
Visit an element.
static bool compare(const Dependency &first, const Dependency &second)
Static helper function for DependencyList::unique.
auto format(const std::locale &loc, const CharT *fmt, const Streamable &tp) -> decltype(to_stream(std::declval< std::basic_ostream< CharT > & >(), fmt, tp), std::basic_string< CharT >{})
@ XML_ERROR_MISMATCHED_ELEMENT
@ XML_ELEMENT_DEPTH_EXCEEDED
@ XML_ERROR_EMPTY_DOCUMENT
@ XML_ERROR_PARSING_ATTRIBUTE
@ XML_ERROR_FILE_NOT_FOUND
@ XML_ERROR_PARSING_COMMENT
@ XML_ERROR_FILE_READ_ERROR
@ XML_ERROR_PARSING_UNKNOWN
@ XML_ERROR_PARSING_CDATA
@ XML_ERROR_PARSING_DECLARATION
@ XML_WRONG_ATTRIBUTE_TYPE
@ XML_ERROR_PARSING_ELEMENT
@ XML_ERROR_FILE_COULD_NOT_BE_OPENED
@ XML_CAN_NOT_CONVERT_TEXT
Item items[ITEMS_PER_BLOCK]
static const int TINYXML2_MAX_ELEMENT_DEPTH
static const int TIXML2_PATCH_VERSION
static const int TIXML2_MAJOR_VERSION
static const int TIXML2_MINOR_VERSION