Public Member Functions | |
XMLDocument (bool processEntities=true, Whitespace whitespaceMode=PRESERVE_WHITESPACE) | |
constructor More... | |
virtual XMLDocument * | ToDocument () |
Safely cast to a Document, or null. More... | |
virtual const XMLDocument * | ToDocument () const |
XMLError | Parse (const char *xml, int nBytes=static_cast< int >(-1)) |
XMLError | LoadFile (const char *filename) |
XMLError | LoadFile (FILE *) |
XMLError | SaveFile (const char *filename, bool compact=false) |
XMLError | SaveFile (FILE *fp, bool compact=false) |
bool | ProcessEntities () const |
Whitespace | WhitespaceMode () const |
bool | HasBOM () const |
void | SetBOM (bool useBOM) |
XMLElement * | RootElement () |
const XMLElement * | RootElement () const |
void | Print (XMLPrinter *streamer=nullptr) const |
virtual bool | Accept (XMLVisitor *visitor) const |
XMLElement * | NewElement (const char *name) |
XMLComment * | NewComment (const char *comment) |
XMLText * | NewText (const char *text) |
XMLDeclaration * | NewDeclaration (const char *text=nullptr) |
XMLUnknown * | NewUnknown (const char *text) |
void | DeleteNode (XMLNode *node) |
void | ClearError () |
bool | Error () const |
Return true if there was an error parsing the document. More... | |
XMLError | ErrorID () const |
Return the errorID. More... | |
const char * | ErrorName () const |
const char * | ErrorStr () const |
void | PrintError () const |
A(trivial) utility function that prints the ErrorStr() to stdout. More... | |
int | ErrorLineNum () const |
Return the line where the error occured, or zero if unknown. More... | |
void | Clear () |
Clear the document, resetting it to the initial state. More... | |
void | DeepCopy (XMLDocument *target) const |
char * | Identify (char *p, XMLNode **node) |
void | MarkInUse (XMLNode *) |
virtual XMLNode * | ShallowClone (XMLDocument *) const |
virtual bool | ShallowEqual (const XMLNode *) const |
![]() | |
const XMLDocument * | GetDocument () const |
Get the XMLDocument that owns this XMLNode. More... | |
XMLDocument * | GetDocument () |
Get the XMLDocument that owns this XMLNode. More... | |
virtual XMLElement * | ToElement () |
Safely cast to an Element, or null. More... | |
virtual XMLText * | ToText () |
Safely cast to Text, or null. More... | |
virtual XMLComment * | ToComment () |
Safely cast to a Comment, or null. More... | |
virtual XMLDeclaration * | ToDeclaration () |
Safely cast to a Declaration, or null. More... | |
virtual XMLUnknown * | ToUnknown () |
Safely cast to an Unknown, or null. More... | |
virtual const XMLElement * | ToElement () const |
virtual const XMLText * | ToText () const |
virtual const XMLComment * | ToComment () const |
virtual const XMLDeclaration * | ToDeclaration () const |
virtual const XMLUnknown * | ToUnknown () const |
const char * | Value () const |
void | SetValue (const char *val, bool staticMem=false) |
int | GetLineNum () const |
Gets the line number the node is in, if the document was parsed from a file. More... | |
const XMLNode * | Parent () const |
Get the parent of this node on the DOM. More... | |
XMLNode * | Parent () |
bool | NoChildren () const |
Returns true if this node has no children. More... | |
const XMLNode * | FirstChild () const |
Get the first child node, or null if none exists. More... | |
XMLNode * | FirstChild () |
const XMLElement * | FirstChildElement (const char *name=nullptr) const |
XMLElement * | FirstChildElement (const char *name=nullptr) |
const XMLNode * | LastChild () const |
Get the last child node, or null if none exists. More... | |
XMLNode * | LastChild () |
const XMLElement * | LastChildElement (const char *name=nullptr) const |
XMLElement * | LastChildElement (const char *name=nullptr) |
const XMLNode * | PreviousSibling () const |
Get the previous(left) sibling node of this node. More... | |
XMLNode * | PreviousSibling () |
const XMLElement * | PreviousSiblingElement (const char *name=nullptr) const |
Get the previous(left) sibling element of this node, with an optionally supplied name. More... | |
XMLElement * | PreviousSiblingElement (const char *name=nullptr) |
const XMLNode * | NextSibling () const |
Get the next(right) sibling node of this node. More... | |
XMLNode * | NextSibling () |
const XMLElement * | NextSiblingElement (const char *name=nullptr) const |
Get the next(right) sibling element of this node, with an optionally supplied name. More... | |
XMLElement * | NextSiblingElement (const char *name=nullptr) |
XMLNode * | InsertEndChild (XMLNode *addThis) |
XMLNode * | LinkEndChild (XMLNode *addThis) |
XMLNode * | InsertFirstChild (XMLNode *addThis) |
XMLNode * | InsertAfterChild (XMLNode *afterThis, XMLNode *addThis) |
void | DeleteChildren () |
void | DeleteChild (XMLNode *node) |
XMLNode * | DeepClone (XMLDocument *target) const |
void | SetUserData (void *userData) |
void * | GetUserData () const |
Static Public Member Functions | |
static const char * | ErrorIDToName (XMLError errorID) |
Private Member Functions | |
XMLDocument (const XMLDocument &) | |
void | operator= (const XMLDocument &) |
void | Parse () |
void | SetError (XMLError error, int lineNum, const char *format,...) |
template<class NodeType , int PoolElementSize> | |
NodeType * | CreateUnlinkedNode (MemPoolT< PoolElementSize > &pool) |
Private Attributes | |
bool | _writeBOM |
bool | _processEntities |
XMLError | _errorID |
Whitespace | _whitespaceMode |
StrPair | _errorStr |
int | _errorLineNum |
char * | _charBuffer |
int | _parseCurLineNum |
DynArray< XMLNode *, 10 > | _unlinked |
MemPoolT< sizeof(XMLElement) > | _elementPool |
MemPoolT< sizeof(XMLAttribute) > | _attributePool |
MemPoolT< sizeof(XMLText) > | _textPool |
MemPoolT< sizeof(XMLComment) > | _commentPool |
Static Private Attributes | |
static const char * | _errorNames [XML_ERROR_COUNT] |
Friends | |
class | XMLElement |
class | XMLNode |
class | XMLText |
class | XMLComment |
class | XMLDeclaration |
class | XMLUnknown |
Additional Inherited Members | |
![]() | |
XMLNode (XMLDocument *) | |
virtual char * | ParseDeep (char *p, StrPair *parentEndTag, int *curLineNumPtr) |
![]() | |
XMLDocument * | _document |
XMLNode * | _parent |
StrPair | _value |
int | _parseLineNum |
XMLNode * | _firstChild |
XMLNode * | _lastChild |
XMLNode * | _prev |
XMLNode * | _next |
void * | _userData |
Definition at line 1652 of file tinyxml2.h.
XMLDocument | ( | bool | processEntities = true , |
Whitespace | whitespaceMode = PRESERVE_WHITESPACE |
||
) |
constructor
Definition at line 2190 of file tinyxml2.cpp.
~XMLDocument | ( | ) |
Definition at line 2211 of file tinyxml2.cpp.
|
virtual |
Implements XMLNode.
Definition at line 795 of file tinyxml2.cpp.
void Clear | ( | ) |
Clear the document, resetting it to the initial state.
Definition at line 2232 of file tinyxml2.cpp.
|
inline |
Definition at line 1814 of file tinyxml2.h.
|
inlineprivate |
Definition at line 1903 of file tinyxml2.h.
void DeepCopy | ( | XMLDocument * | target | ) | const |
Definition at line 2267 of file tinyxml2.cpp.
void DeleteNode | ( | XMLNode * | node | ) |
Definition at line 2338 of file tinyxml2.cpp.
|
inline |
Return true if there was an error parsing the document.
Definition at line 1819 of file tinyxml2.h.
|
inline |
Return the errorID.
Definition at line 1823 of file tinyxml2.h.
|
static |
Definition at line 2550 of file tinyxml2.cpp.
|
inline |
Return the line where the error occured, or zero if unknown.
Definition at line 1838 of file tinyxml2.h.
const char * ErrorName | ( | ) | const |
Definition at line 2569 of file tinyxml2.cpp.
const char * ErrorStr | ( | ) | const |
Definition at line 2558 of file tinyxml2.cpp.
|
inline |
Definition at line 1734 of file tinyxml2.h.
char * Identify | ( | char * | p, |
XMLNode ** | node | ||
) |
Definition at line 718 of file tinyxml2.cpp.
XMLError LoadFile | ( | const char * | filename | ) |
Definition at line 2359 of file tinyxml2.cpp.
XMLError LoadFile | ( | FILE * | fp | ) |
Definition at line 2398 of file tinyxml2.cpp.
void MarkInUse | ( | XMLNode * | node | ) |
Definition at line 2217 of file tinyxml2.cpp.
XMLComment * NewComment | ( | const char * | comment | ) |
Definition at line 2290 of file tinyxml2.cpp.
XMLDeclaration * NewDeclaration | ( | const char * | text = nullptr | ) |
Definition at line 2306 of file tinyxml2.cpp.
XMLElement * NewElement | ( | const char * | name | ) |
Definition at line 2282 of file tinyxml2.cpp.
XMLText * NewText | ( | const char * | text | ) |
Definition at line 2298 of file tinyxml2.cpp.
XMLUnknown * NewUnknown | ( | const char * | text | ) |
Definition at line 2314 of file tinyxml2.cpp.
|
private |
Definition at line 2574 of file tinyxml2.cpp.
XMLError Parse | ( | const char * | xml, |
int | nBytes = static_cast<int>(-1) |
||
) |
Definition at line 2474 of file tinyxml2.cpp.
void Print | ( | XMLPrinter * | streamer = nullptr | ) | const |
Definition at line 2508 of file tinyxml2.cpp.
void PrintError | ( | ) | const |
A(trivial) utility function that prints the ErrorStr() to stdout.
Definition at line 2564 of file tinyxml2.cpp.
|
inline |
Definition at line 1724 of file tinyxml2.h.
|
inline |
Definition at line 1747 of file tinyxml2.h.
|
inline |
Definition at line 1750 of file tinyxml2.h.
XMLError SaveFile | ( | const char * | filename, |
bool | compact = false |
||
) |
Definition at line 2449 of file tinyxml2.cpp.
XMLError SaveFile | ( | FILE * | fp, |
bool | compact = false |
||
) |
Definition at line 2463 of file tinyxml2.cpp.
|
inline |
Definition at line 1740 of file tinyxml2.h.
|
private |
Definition at line 2522 of file tinyxml2.cpp.
|
inlinevirtual |
Implements XMLNode.
Definition at line 1860 of file tinyxml2.h.
|
inlinevirtual |
Implements XMLNode.
Definition at line 1863 of file tinyxml2.h.
|
inlinevirtual |
Safely cast to a Document, or null.
Reimplemented from XMLNode.
Definition at line 1667 of file tinyxml2.h.
|
inlinevirtual |
Reimplemented from XMLNode.
Definition at line 1671 of file tinyxml2.h.
|
inline |
Definition at line 1727 of file tinyxml2.h.
|
friend |
Definition at line 1659 of file tinyxml2.h.
|
friend |
Definition at line 1660 of file tinyxml2.h.
|
friend |
Definition at line 1654 of file tinyxml2.h.
|
friend |
Definition at line 1657 of file tinyxml2.h.
|
friend |
Definition at line 1658 of file tinyxml2.h.
|
friend |
Definition at line 1661 of file tinyxml2.h.
|
private |
Definition at line 1888 of file tinyxml2.h.
|
private |
Definition at line 1877 of file tinyxml2.h.
|
private |
Definition at line 1890 of file tinyxml2.h.
|
private |
Definition at line 1887 of file tinyxml2.h.
|
private |
Definition at line 1873 of file tinyxml2.h.
|
private |
Definition at line 1876 of file tinyxml2.h.
|
staticprivate |
Definition at line 1892 of file tinyxml2.h.
|
mutableprivate |
Definition at line 1875 of file tinyxml2.h.
|
private |
Definition at line 1878 of file tinyxml2.h.
|
private |
Definition at line 1872 of file tinyxml2.h.
Definition at line 1889 of file tinyxml2.h.
Definition at line 1885 of file tinyxml2.h.
|
private |
Definition at line 1874 of file tinyxml2.h.
|
private |
Definition at line 1871 of file tinyxml2.h.