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 ) do { if ( !((void)0,(x))) { __debugbreak(); } } while(false)
87# elif defined (ANDROID_NDK)
88# include <android/log.h>
89# define TIXMLASSERT( x ) do { if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); } } while(false)
92# define TIXMLASSERT assert
95# define TIXMLASSERT( x ) do {} while(false)
102static const int TIXML2_MAJOR_VERSION = 9;
103static const int TIXML2_MINOR_VERSION = 0;
104static const int TIXML2_PATCH_VERSION = 0;
106#define TINYXML2_MAJOR_VERSION 9
107#define TINYXML2_MINOR_VERSION 0
108#define TINYXML2_PATCH_VERSION 0
115static const int TINYXML2_MAX_ELEMENT_DEPTH = 500;
155 void Set(
char* start,
char* end,
int flags ) {
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 );
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",
558 if (curLineNumPtr && *p ==
'\n') {
567 return const_cast<char*
>(
SkipWhiteSpace(
const_cast<const char*
>(p), curLineNumPtr ) );
581 if ( isalpha( ch ) ) {
584 return ch ==
':' || ch ==
'_';
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 );
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 );
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);
749 void SetValue(
const char* val,
bool staticMem=
false );
783 return const_cast<XMLElement*
>(
const_cast<const XMLNode*
>(
this)->FirstChildElement( name ));
801 return const_cast<XMLElement*
>(
const_cast<const XMLNode*
>(
this)->LastChildElement(name) );
817 return const_cast<XMLElement*
>(
const_cast<const XMLNode*
>(
this)->PreviousSiblingElement( name ) );
833 return const_cast<XMLElement*
>(
const_cast<const XMLNode*
>(
this)->NextSiblingElement( name ) );
1250 char*
ParseDeep(
char* p,
bool processEntities,
int* curLineNumPtr );
1273 void SetName(
const char* str,
bool staticMem=
false ) {
1308 const char*
Attribute(
const char* name,
const char* value=0 )
const;
1409 *value = a->
Value();
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;
2121 return (
_node ?
_node->ToDeclaration() : 0 );
2187 return (
_node ?
_node->ToDeclaration() : 0 );
2334 virtual void Print(
const char* format, ... );
2335 virtual void Write(
const char* data,
size_t size );
2338 inline void Write(
const char* data) {
Write(data, strlen(data)); }
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
void operator=(const MemPoolT &)
virtual void Free(void *mem)
int CurrentAllocs() const
void Trace(const char *name)
virtual int ItemSize() const
DynArray< Block *, 10 > _blockPtrs
MemPoolT(const MemPoolT &)
void SetStr(const char *str, int flags=0)
void SetInternedStr(const char *str)
void TransferTo(StrPair *other)
void Set(char *start, char *end, int flags)
char * ParseText(char *in, const char *endTag, int strFlags, int *curLineNumPtr)
char * ParseName(char *in)
void operator=(const StrPair &other)
@ TEXT_ELEMENT_LEAVE_ENTITIES
@ NEEDS_ENTITY_PROCESSING
@ NEEDS_NEWLINE_NORMALIZATION
@ ATTRIBUTE_VALUE_LEAVE_ENTITIES
@ NEEDS_WHITESPACE_COLLAPSING
StrPair(const StrPair &other)
void CollapseWhitespace()
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()
void SetAttribute(uint64_t value)
Set the attribute to value.
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 &)
void SetName(const char *name)
XMLError QueryUnsignedValue(unsigned int *value) const
See QueryIntValue.
char * ParseDeep(char *p, bool processEntities, int *curLineNumPtr)
double DoubleValue() const
Query as a double. See IntValue()
XMLError QueryInt64Value(int64_t *value) const
See QueryIntValue.
const char * Name() const
The name of the attribute.
XMLError QueryBoolValue(bool *value) const
See QueryIntValue.
XMLError QueryIntValue(int *value) const
void SetAttribute(int64_t value)
Set the attribute to value.
int64_t Int64Value() const
bool BoolValue() const
Query as a boolean. See IntValue()
void SetAttribute(double value)
Set the attribute to value.
const XMLAttribute * Next() const
The next attribute in the list.
const char * Value() const
The value of the attribute.
uint64_t Unsigned64Value() const
void SetAttribute(bool value)
Set the attribute to value.
void SetAttribute(int value)
Set the attribute to value.
void SetAttribute(unsigned value)
Set the attribute to value.
void SetAttribute(float value)
Set the attribute to value.
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 &)
virtual ~XMLDeclaration()
char * ParseDeep(char *p, StrPair *parentEndTag, int *curLineNumPtr)
XMLDeclaration(const XMLDeclaration &)
virtual bool Accept(XMLVisitor *visitor) const
virtual const XMLDeclaration * ToDeclaration() const
virtual XMLDeclaration * ToDeclaration()
Safely cast to a Declaration, or null.
virtual bool ShallowEqual(const XMLNode *compare) const
virtual XMLNode * ShallowClone(XMLDocument *document) const
XMLDeclaration(XMLDocument *doc)
DepthTracker(XMLDocument *document)
MemPoolT< sizeof(XMLAttribute) > _attributePool
static const char * ErrorIDToName(XMLError errorID)
XMLElement * RootElement()
const char * ErrorName() const
void PrintError() const
A (trivial) utility function that prints the ErrorStr() to stdout.
MemPoolT< sizeof(XMLElement) > _elementPool
char * Identify(char *p, XMLNode **node)
XMLError LoadFile(const char *filename)
bool Error() const
Return true if there was an error parsing the document.
XMLComment * NewComment(const char *comment)
XMLElement * NewElement(const char *name)
void ClearError()
Clears the error flags.
XMLUnknown * NewUnknown(const char *text)
const XMLElement * RootElement() const
bool ProcessEntities() const
int ErrorLineNum() const
Return the line where the error occurred, or zero if unknown.
XMLDocument(bool processEntities=true, Whitespace whitespaceMode=PRESERVE_WHITESPACE)
constructor
XMLError LoadFile(FILE *)
void MarkInUse(const XMLNode *const)
void Clear()
Clear the document, resetting it to the initial state.
virtual bool ShallowEqual(const XMLNode *) const
XMLError SaveFile(const char *filename, bool compact=false)
Whitespace WhitespaceMode() const
void Print(XMLPrinter *streamer=0) const
virtual XMLDocument * ToDocument()
Safely cast to a Document, or null.
XMLError SaveFile(FILE *fp, bool compact=false)
friend class XMLDeclaration
virtual bool Accept(XMLVisitor *visitor) const
void operator=(const XMLDocument &)
void SetError(XMLError error, int lineNum, const char *format,...)
void DeleteNode(XMLNode *node)
MemPoolT< sizeof(XMLComment) > _commentPool
DynArray< XMLNode *, 10 > _unlinked
virtual const XMLDocument * ToDocument() const
NodeType * CreateUnlinkedNode(MemPoolT< PoolElementSize > &pool)
XMLText * NewText(const char *text)
XMLDocument(const XMLDocument &)
XMLDeclaration * NewDeclaration(const char *text=0)
const char * ErrorStr() const
XMLError Parse(const char *xml, size_t nBytes=static_cast< size_t >(-1))
static const char * _errorNames[XML_ERROR_COUNT]
virtual XMLNode * ShallowClone(XMLDocument *) const
void DeepCopy(XMLDocument *target) const
XMLError ErrorID() const
Return the errorID.
MemPoolT< sizeof(XMLText) > _textPool
Whitespace _whitespaceMode
char * ParseDeep(char *p, StrPair *parentEndTag, int *curLineNumPtr)
const char * GetText() const
double DoubleAttribute(const char *name, double defaultValue=0) const
See IntAttribute()
XMLAttribute * CreateAttribute()
void SetAttribute(const char *name, const char *value)
Sets the named attribute to value.
XMLError QueryInt64Text(int64_t *uval) const
See QueryIntText()
XMLError QueryUnsigned64Attribute(const char *name, uint64_t *value) const
See QueryIntAttribute()
XMLError QueryBoolAttribute(const char *name, bool *value) const
See QueryIntAttribute()
XMLError QueryUnsignedText(unsigned *uval) const
See QueryIntText()
const XMLAttribute * FindAttribute(const char *name) const
Query a specific attribute in the list.
XMLError QueryAttribute(const char *name, bool *value) const
XMLElement(const XMLElement &)
char * ParseAttributes(char *p, int *curLineNumPtr)
virtual XMLNode * ShallowClone(XMLDocument *document) const
void SetText(const char *inText)
uint64_t Unsigned64Attribute(const char *name, uint64_t defaultValue=0) const
See IntAttribute()
void SetAttribute(const char *name, double value)
Sets the named attribute to value.
XMLError QueryUnsignedAttribute(const char *name, unsigned int *value) const
See QueryIntAttribute()
int IntText(int defaultValue=0) const
virtual bool Accept(XMLVisitor *visitor) const
ElementClosingType _closingType
XMLError QueryBoolText(bool *bval) const
See QueryIntText()
XMLError QueryAttribute(const char *name, unsigned int *value) const
float FloatText(float defaultValue=0) const
See QueryIntText()
XMLError QueryAttribute(const char *name, int64_t *value) const
const char * Attribute(const char *name, const char *value=0) const
unsigned UnsignedText(unsigned defaultValue=0) const
See QueryIntText()
const XMLAttribute * FirstAttribute() const
Return the first attribute in the list.
XMLError QueryAttribute(const char *name, double *value) const
void SetText(float value)
Convenience method for setting text inside an element. See SetText() for important limitations.
XMLElement(XMLDocument *doc)
bool BoolAttribute(const char *name, bool defaultValue=false) const
See IntAttribute()
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()
int64_t Int64Attribute(const char *name, int64_t defaultValue=0) const
See IntAttribute()
void SetText(double value)
Convenience method for setting text inside an element. See SetText() for important limitations.
XMLError QueryDoubleText(double *dval) const
See QueryIntText()
bool BoolText(bool defaultValue=false) const
See QueryIntText()
ElementClosingType ClosingType() const
void SetText(uint64_t value)
Convenience method for setting text inside an element. See SetText() for important limitations.
void SetText(int64_t value)
Convenience method for setting text inside an element. See SetText() for important limitations.
void SetText(unsigned value)
Convenience method for setting text inside an element. See SetText() for important limitations.
XMLError QueryInt64Attribute(const char *name, int64_t *value) const
See QueryIntAttribute()
XMLDeclaration * InsertNewDeclaration(const char *text)
See InsertNewChildElement()
double DoubleText(double defaultValue=0) const
See QueryIntText()
XMLError QueryIntAttribute(const char *name, int *value) const
XMLError QueryIntText(int *ival) const
int IntAttribute(const char *name, int defaultValue=0) 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.
int64_t Int64Text(int64_t defaultValue=0) const
See QueryIntText()
void SetAttribute(const char *name, int value)
Sets the named attribute to value.
XMLComment * InsertNewComment(const char *comment)
See InsertNewChildElement()
void SetAttribute(const char *name, int64_t value)
Sets the named attribute to value.
float FloatAttribute(const char *name, float defaultValue=0) const
See IntAttribute()
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.)
XMLElement * InsertNewChildElement(const char *name)
XMLError QueryUnsigned64Text(uint64_t *uval) const
See QueryIntText()
XMLText * InsertNewText(const char *text)
See InsertNewChildElement()
XMLError QueryAttribute(const char *name, float *value) const
XMLAttribute * FindOrCreateAttribute(const char *name)
XMLError QueryFloatAttribute(const char *name, float *value) const
See QueryIntAttribute()
XMLError QueryAttribute(const char *name, uint64_t *value) const
void SetAttribute(const char *name, uint64_t value)
Sets the named attribute to value.
XMLAttribute * _rootAttribute
virtual bool ShallowEqual(const XMLNode *compare) const
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 &)
void SetText(bool value)
Convenience method for setting text inside an element. See SetText() for important limitations.
XMLError QueryAttribute(const char *name, const char **value) const
void SetText(int value)
Convenience method for setting text inside an element. See SetText() for important limitations.
void DeleteAttribute(const char *name)
uint64_t Unsigned64Text(uint64_t defaultValue=0) const
See QueryIntText()
static void DeleteAttribute(XMLAttribute *attribute)
XMLError QueryFloatText(float *fval) const
See QueryIntText()
XMLUnknown * InsertNewUnknown(const char *text)
See InsertNewChildElement()
unsigned UnsignedAttribute(const char *name, unsigned defaultValue=0) const
See IntAttribute()
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)
const char * Value() const
virtual const XMLText * ToText() const
void SetValue(const char *val, bool staticMem=false)
virtual XMLText * ToText()
Safely cast to Text, or null.
void InsertChildPreamble(XMLNode *insertThis) const
virtual XMLDeclaration * ToDeclaration()
Safely cast to a Declaration, or null.
const XMLElement * NextSiblingElement(const char *name=0) const
Get the next (right) sibling element of this node, with an optionally supplied name.
void * GetUserData() const
const XMLElement * FirstChildElement(const char *name=0) const
void DeleteChild(XMLNode *node)
XMLNode * DeepClone(XMLDocument *target) 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 &)
const XMLElement * ToElementWithName(const char *name) const
XMLNode * PreviousSibling()
virtual XMLComment * ToComment()
Safely cast to a Comment, or null.
const XMLElement * LastChildElement(const char *name=0) const
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
XMLNode * InsertAfterChild(XMLNode *afterThis, XMLNode *addThis)
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.
const XMLElement * PreviousSiblingElement(const char *name=0) const
Get the previous (left) sibling element of this node, with an optionally supplied name.
void Unlink(XMLNode *child)
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.
XMLNode * InsertFirstChild(XMLNode *addThis)
virtual char * ParseDeep(char *p, StrPair *parentEndTag, int *curLineNumPtr)
virtual const XMLDocument * ToDocument() const
XMLNode * InsertEndChild(XMLNode *addThis)
XMLNode * LinkEndChild(XMLNode *addThis)
virtual const XMLComment * ToComment() const
static void DeleteNode(XMLNode *node)
const XMLNode * NextSibling() const
Get the next (right) sibling node of this node.
virtual void PrintSpace(int depth)
virtual void Putc(char ch)
void PushAttribute(const char *name, uint64_t value)
XMLPrinter(const XMLPrinter &)
virtual bool VisitExit(const XMLDocument &)
Visit a document.
void PushAttribute(const char *name, double value)
void PushHeader(bool writeBOM, bool writeDeclaration)
DynArray< char, 20 > _buffer
void PushText(const char *text, bool cdata=false)
Add a text node.
void PushText(float value)
Add a text node from a float.
void OpenElement(const char *name, bool compactMode=false)
virtual bool Visit(const XMLText &text)
Visit a text node.
virtual bool VisitEnter(const XMLElement &element, const XMLAttribute *attribute)
Visit an element.
void PushDeclaration(const char *value)
virtual bool CompactMode(const XMLElement &)
void PushText(int value)
Add a text node from an integer.
virtual bool Visit(const XMLComment &comment)
Visit a comment node.
void PushText(bool value)
Add a text node from a bool.
void Write(const char *data)
virtual void Print(const char *format,...)
void PushAttribute(const char *name, bool value)
void PrintString(const char *, bool restrictedEntitySet)
void PushText(uint64_t value)
Add a text node from an unsigned 64bit integer.
virtual void Write(const char *data, size_t size)
void PushText(unsigned value)
Add a text node from an unsigned.
void ClearBuffer(bool resetToFirstElement=true)
void PushAttribute(const char *name, int value)
bool _restrictedEntityFlag[ENTITY_RANGE]
void PrepareForNewNode(bool compactMode)
void PushText(int64_t value)
Add a text node from a signed 64bit integer.
void PushAttribute(const char *name, const char *value)
If streaming, add an attribute to an open element.
void PushAttribute(const char *name, int64_t value)
virtual bool Visit(const XMLDeclaration &declaration)
Visit a declaration.
virtual bool Visit(const XMLUnknown &unknown)
Visit an unknown node.
void PushAttribute(const char *name, unsigned value)
XMLPrinter(FILE *file=0, bool compact=false, int depth=0)
void PushText(double value)
Add a text node from a double.
void PushUnknown(const char *value)
bool _entityFlag[ENTITY_RANGE]
const char * CStr() const
void SealElementIfJustOpened()
virtual void CloseElement(bool compactMode=false)
If streaming, close the Element.
XMLPrinter & operator=(const XMLPrinter &)
DynArray< const char *, 10 > _stack
virtual bool VisitEnter(const XMLDocument &)
Visit a document.
virtual bool VisitExit(const XMLElement &element)
Visit an element.
void PushComment(const char *comment)
Add a comment.
virtual bool Accept(XMLVisitor *visitor) const
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 bool ShallowEqual(const XMLNode *compare) const
virtual XMLNode * ShallowClone(XMLDocument *document) const
char * ParseDeep(char *p, StrPair *parentEndTag, int *curLineNumPtr)
virtual bool ShallowEqual(const XMLNode *compare) const
virtual bool Accept(XMLVisitor *visitor) const
virtual XMLUnknown * ToUnknown()
Safely cast to an Unknown, or null.
virtual XMLNode * ShallowClone(XMLDocument *document) const
XMLUnknown(XMLDocument *doc)
XMLUnknown(const XMLUnknown &)
virtual const XMLUnknown * ToUnknown() const
XMLUnknown & operator=(const XMLUnknown &)
char * ParseDeep(char *p, StrPair *parentEndTag, int *curLineNumPtr)
static bool IsNameChar(unsigned char ch)
static const char * GetCharacterRef(const char *p, char *value, int *length)
static void ToStr(unsigned v, char *buffer, int bufferSize)
static bool IsPrefixHex(const char *p)
static const char * writeBoolTrue
static bool IsWhiteSpace(char p)
static bool ToUnsigned(const char *str, unsigned *value)
static void ToStr(int v, char *buffer, int bufferSize)
static void ToStr(double v, char *buffer, int bufferSize)
static void ToStr(float v, char *buffer, int bufferSize)
static bool ToDouble(const char *str, double *value)
static bool ToInt64(const char *str, int64_t *value)
static bool IsUTF8Continuation(const char p)
static bool ToUnsigned64(const char *str, uint64_t *value)
static void SetBoolSerialization(const char *writeTrue, const char *writeFalse)
static void ConvertUTF32ToUTF8(unsigned long input, char *output, int *length)
static void ToStr(int64_t v, char *buffer, int bufferSize)
static bool IsNameStartChar(unsigned char ch)
static bool ToFloat(const char *str, float *value)
static bool ToInt(const char *str, int *value)
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 * ReadBOM(const char *p, bool *hasBOM)
static void ToStr(bool v, char *buffer, int bufferSize)
static bool ToBool(const char *str, bool *value)
static char * SkipWhiteSpace(char *const p, int *curLineNumPtr)
static const char * writeBoolFalse
static void ToStr(uint64_t v, char *buffer, int bufferSize)
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.
@ XML_ERROR_PARSING_CDATA
@ XML_ERROR_FILE_COULD_NOT_BE_OPENED
@ XML_ERROR_PARSING_DECLARATION
@ XML_ERROR_PARSING_ATTRIBUTE
@ XML_ERROR_EMPTY_DOCUMENT
@ XML_CAN_NOT_CONVERT_TEXT
@ XML_WRONG_ATTRIBUTE_TYPE
@ XML_ELEMENT_DEPTH_EXCEEDED
@ XML_ERROR_MISMATCHED_ELEMENT
@ XML_ERROR_PARSING_COMMENT
@ XML_ERROR_PARSING_UNKNOWN
@ XML_ERROR_FILE_READ_ERROR
@ XML_ERROR_FILE_NOT_FOUND
@ XML_ERROR_PARSING_ELEMENT
Item items[ITEMS_PER_BLOCK]