XMLNode Class Referenceabstract
Inheritance diagram for XMLNode:
XMLComment XMLDeclaration XMLDocument XMLElement XMLText XMLUnknown

Public Member Functions

const XMLDocumentGetDocument () const
 Get the XMLDocument that owns this XMLNode. More...
 
XMLDocumentGetDocument ()
 Get the XMLDocument that owns this XMLNode. More...
 
virtual XMLElementToElement ()
 Safely cast to an Element, or null. More...
 
virtual XMLTextToText ()
 Safely cast to Text, or null. More...
 
virtual XMLCommentToComment ()
 Safely cast to a Comment, or null. More...
 
virtual XMLDocumentToDocument ()
 Safely cast to a Document, or null. More...
 
virtual XMLDeclarationToDeclaration ()
 Safely cast to a Declaration, or null. More...
 
virtual XMLUnknownToUnknown ()
 Safely cast to an Unknown, or null. More...
 
virtual const XMLElementToElement () const
 
virtual const XMLTextToText () const
 
virtual const XMLCommentToComment () const
 
virtual const XMLDocumentToDocument () const
 
virtual const XMLDeclarationToDeclaration () const
 
virtual const XMLUnknownToUnknown () 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 XMLNodeParent () const
 Get the parent of this node on the DOM. More...
 
XMLNodeParent ()
 
bool NoChildren () const
 Returns true if this node has no children. More...
 
const XMLNodeFirstChild () const
 Get the first child node, or null if none exists. More...
 
XMLNodeFirstChild ()
 
const XMLElementFirstChildElement (const char *name=nullptr) const
 
XMLElementFirstChildElement (const char *name=nullptr)
 
const XMLNodeLastChild () const
 Get the last child node, or null if none exists. More...
 
XMLNodeLastChild ()
 
const XMLElementLastChildElement (const char *name=nullptr) const
 
XMLElementLastChildElement (const char *name=nullptr)
 
const XMLNodePreviousSibling () const
 Get the previous(left) sibling node of this node. More...
 
XMLNodePreviousSibling ()
 
const XMLElementPreviousSiblingElement (const char *name=nullptr) const
 Get the previous(left) sibling element of this node, with an optionally supplied name. More...
 
XMLElementPreviousSiblingElement (const char *name=nullptr)
 
const XMLNodeNextSibling () const
 Get the next(right) sibling node of this node. More...
 
XMLNodeNextSibling ()
 
const XMLElementNextSiblingElement (const char *name=nullptr) const
 Get the next(right) sibling element of this node, with an optionally supplied name. More...
 
XMLElementNextSiblingElement (const char *name=nullptr)
 
XMLNodeInsertEndChild (XMLNode *addThis)
 
XMLNodeLinkEndChild (XMLNode *addThis)
 
XMLNodeInsertFirstChild (XMLNode *addThis)
 
XMLNodeInsertAfterChild (XMLNode *afterThis, XMLNode *addThis)
 
void DeleteChildren ()
 
void DeleteChild (XMLNode *node)
 
virtual XMLNodeShallowClone (XMLDocument *document) const =0
 
XMLNodeDeepClone (XMLDocument *target) const
 
virtual bool ShallowEqual (const XMLNode *compare) const =0
 
virtual bool Accept (XMLVisitor *visitor) const =0
 
void SetUserData (void *userData)
 
void * GetUserData () const
 

Protected Member Functions

 XMLNode (XMLDocument *)
 
virtual char * ParseDeep (char *p, StrPair *parentEndTag, int *curLineNumPtr)
 

Protected Attributes

XMLDocument_document
 
XMLNode_parent
 
StrPair _value
 
int _parseLineNum
 
XMLNode_firstChild
 
XMLNode_lastChild
 
XMLNode_prev
 
XMLNode_next
 
void * _userData
 

Private Member Functions

void Unlink (XMLNode *child)
 
void InsertChildPreamble (XMLNode *insertThis) const
 
const XMLElementToElementWithName (const char *name) const
 
 XMLNode (const XMLNode &)
 
XMLNodeoperator= (const XMLNode &)
 

Static Private Member Functions

static void DeleteNode (XMLNode *node)
 

Private Attributes

MemPool_memPool
 

Friends

class XMLDocument
 
class XMLElement
 

Detailed Description

Definition at line 662 of file tinyxml2.h.

Constructor & Destructor Documentation

◆ XMLNode()

XMLNode ( XMLDocument doc)
protected

Definition at line 814 of file tinyxml2.cpp.

◆ ~XMLNode()

~XMLNode ( )
protectedvirtual

Definition at line 827 of file tinyxml2.cpp.

Member Function Documentation

◆ DeepClone()

XMLNode * DeepClone ( XMLDocument target) const

Definition at line 856 of file tinyxml2.cpp.

◆ DeleteChild()

void DeleteChild ( XMLNode node)

Definition at line 909 of file tinyxml2.cpp.

◆ DeleteChildren()

void DeleteChildren ( )

Definition at line 870 of file tinyxml2.cpp.

◆ DeleteNode()

void DeleteNode ( XMLNode node)
staticprivate

Definition at line 1205 of file tinyxml2.cpp.

◆ FirstChild() [1/2]

XMLNode * FirstChild ( )
inline

Definition at line 761 of file tinyxml2.h.

◆ FirstChild() [2/2]

const XMLNode * FirstChild ( ) const
inline

Get the first child node, or null if none exists.

Definition at line 757 of file tinyxml2.h.

◆ FirstChildElement() [1/2]

XMLElement * FirstChildElement ( const char *  name = nullptr)
inline

Definition at line 770 of file tinyxml2.h.

◆ FirstChildElement() [2/2]

const XMLElement * FirstChildElement ( const char *  name = nullptr) const

Definition at line 1031 of file tinyxml2.cpp.

◆ GetDocument() [1/2]

XMLDocument * GetDocument ( )
inline

Get the XMLDocument that owns this XMLNode.

Definition at line 674 of file tinyxml2.h.

◆ GetDocument() [2/2]

const XMLDocument * GetDocument ( ) const
inline

Get the XMLDocument that owns this XMLNode.

Definition at line 669 of file tinyxml2.h.

◆ GetLineNum()

int GetLineNum ( ) const
inline

Gets the line number the node is in, if the document was parsed from a file.

Definition at line 740 of file tinyxml2.h.

◆ GetUserData()

void * GetUserData ( ) const
inline

Definition at line 934 of file tinyxml2.h.

◆ InsertAfterChild()

XMLNode * InsertAfterChild ( XMLNode afterThis,
XMLNode addThis 
)

Definition at line 989 of file tinyxml2.cpp.

◆ InsertChildPreamble()

void InsertChildPreamble ( XMLNode insertThis) const
private

Definition at line 1222 of file tinyxml2.cpp.

◆ InsertEndChild()

XMLNode * InsertEndChild ( XMLNode addThis)

Definition at line 922 of file tinyxml2.cpp.

◆ InsertFirstChild()

XMLNode * InsertFirstChild ( XMLNode addThis)

Definition at line 955 of file tinyxml2.cpp.

◆ LastChild() [1/2]

XMLNode * LastChild ( )
inline

Definition at line 779 of file tinyxml2.h.

◆ LastChild() [2/2]

const XMLNode * LastChild ( ) const
inline

Get the last child node, or null if none exists.

Definition at line 775 of file tinyxml2.h.

◆ LastChildElement() [1/2]

XMLElement * LastChildElement ( const char *  name = nullptr)
inline

Definition at line 788 of file tinyxml2.h.

◆ LastChildElement() [2/2]

const XMLElement * LastChildElement ( const char *  name = nullptr) const

Definition at line 1045 of file tinyxml2.cpp.

◆ LinkEndChild()

XMLNode * LinkEndChild ( XMLNode addThis)
inline

Definition at line 833 of file tinyxml2.h.

◆ NextSibling() [1/2]

XMLNode * NextSibling ( )
inline

Definition at line 813 of file tinyxml2.h.

◆ NextSibling() [2/2]

const XMLNode * NextSibling ( ) const
inline

Get the next(right) sibling node of this node.

Definition at line 809 of file tinyxml2.h.

◆ NextSiblingElement() [1/2]

XMLElement * NextSiblingElement ( const char *  name = nullptr)
inline

Definition at line 820 of file tinyxml2.h.

◆ NextSiblingElement() [2/2]

const XMLElement * NextSiblingElement ( const char *  name = nullptr) const

Get the next(right) sibling element of this node, with an optionally supplied name.

Definition at line 1059 of file tinyxml2.cpp.

◆ NoChildren()

bool NoChildren ( ) const
inline

Returns true if this node has no children.

Definition at line 752 of file tinyxml2.h.

◆ Parent() [1/2]

XMLNode * Parent ( )
inline

Definition at line 747 of file tinyxml2.h.

◆ Parent() [2/2]

const XMLNode * Parent ( ) const
inline

Get the parent of this node on the DOM.

Definition at line 743 of file tinyxml2.h.

◆ ParseDeep()

char * ParseDeep ( char *  p,
StrPair parentEndTag,
int *  curLineNumPtr 
)
protectedvirtual

Definition at line 1087 of file tinyxml2.cpp.

◆ PreviousSibling() [1/2]

XMLNode * PreviousSibling ( )
inline

Definition at line 797 of file tinyxml2.h.

◆ PreviousSibling() [2/2]

const XMLNode * PreviousSibling ( ) const
inline

Get the previous(left) sibling node of this node.

Definition at line 793 of file tinyxml2.h.

◆ PreviousSiblingElement() [1/2]

XMLElement * PreviousSiblingElement ( const char *  name = nullptr)
inline

Definition at line 804 of file tinyxml2.h.

◆ PreviousSiblingElement() [2/2]

const XMLElement * PreviousSiblingElement ( const char *  name = nullptr) const

Get the previous(left) sibling element of this node, with an optionally supplied name.

Definition at line 1073 of file tinyxml2.cpp.

◆ SetUserData()

void SetUserData ( void *  userData)
inline

Definition at line 927 of file tinyxml2.h.

◆ SetValue()

void SetValue ( const char *  val,
bool  staticMem = false 
)

Definition at line 844 of file tinyxml2.cpp.

◆ ToComment() [1/2]

virtual XMLComment * ToComment ( )
inlinevirtual

Safely cast to a Comment, or null.

Reimplemented in XMLComment.

Definition at line 688 of file tinyxml2.h.

◆ ToComment() [2/2]

virtual const XMLComment * ToComment ( ) const
inlinevirtual

Definition at line 710 of file tinyxml2.h.

◆ ToDeclaration() [1/2]

virtual XMLDeclaration * ToDeclaration ( )
inlinevirtual

Safely cast to a Declaration, or null.

Reimplemented in XMLDeclaration.

Definition at line 696 of file tinyxml2.h.

◆ ToDeclaration() [2/2]

virtual const XMLDeclaration * ToDeclaration ( ) const
inlinevirtual

Definition at line 716 of file tinyxml2.h.

◆ ToDocument() [1/2]

virtual XMLDocument * ToDocument ( )
inlinevirtual

Safely cast to a Document, or null.

Reimplemented in XMLDocument.

Definition at line 692 of file tinyxml2.h.

◆ ToDocument() [2/2]

virtual const XMLDocument * ToDocument ( ) const
inlinevirtual

Definition at line 713 of file tinyxml2.h.

◆ ToElement() [1/2]

virtual XMLElement * ToElement ( )
inlinevirtual

Safely cast to an Element, or null.

Reimplemented in XMLElement.

Definition at line 680 of file tinyxml2.h.

◆ ToElement() [2/2]

virtual const XMLElement * ToElement ( ) const
inlinevirtual

Definition at line 704 of file tinyxml2.h.

◆ ToElementWithName()

const XMLElement * ToElementWithName ( const char *  name) const
private

Definition at line 1238 of file tinyxml2.cpp.

◆ ToText() [1/2]

virtual XMLText * ToText ( )
inlinevirtual

Safely cast to Text, or null.

Reimplemented in XMLText.

Definition at line 684 of file tinyxml2.h.

◆ ToText() [2/2]

virtual const XMLText * ToText ( ) const
inlinevirtual

Definition at line 707 of file tinyxml2.h.

◆ ToUnknown() [1/2]

virtual XMLUnknown * ToUnknown ( )
inlinevirtual

Safely cast to an Unknown, or null.

Reimplemented in XMLUnknown.

Definition at line 700 of file tinyxml2.h.

◆ ToUnknown() [2/2]

virtual const XMLUnknown * ToUnknown ( ) const
inlinevirtual

Definition at line 719 of file tinyxml2.h.

◆ Unlink()

void Unlink ( XMLNode child)
private

Definition at line 881 of file tinyxml2.cpp.

◆ Value()

const char * Value ( ) const

Definition at line 836 of file tinyxml2.cpp.

Friends And Related Function Documentation

◆ XMLDocument

friend class XMLDocument
friend

Definition at line 664 of file tinyxml2.h.

◆ XMLElement

friend class XMLElement
friend

Definition at line 665 of file tinyxml2.h.

Member Data Documentation

◆ _document

XMLDocument* _document
protected

Definition at line 942 of file tinyxml2.h.

◆ _firstChild

XMLNode* _firstChild
protected

Definition at line 947 of file tinyxml2.h.

◆ _lastChild

XMLNode* _lastChild
protected

Definition at line 948 of file tinyxml2.h.

◆ _memPool

MemPool* _memPool
private

Definition at line 956 of file tinyxml2.h.

◆ _next

XMLNode* _next
protected

Definition at line 951 of file tinyxml2.h.

◆ _parent

XMLNode* _parent
protected

Definition at line 943 of file tinyxml2.h.

◆ _parseLineNum

int _parseLineNum
protected

Definition at line 945 of file tinyxml2.h.

◆ _prev

XMLNode* _prev
protected

Definition at line 950 of file tinyxml2.h.

◆ _userData

void* _userData
protected

Definition at line 953 of file tinyxml2.h.

◆ _value

StrPair _value
mutableprotected

Definition at line 944 of file tinyxml2.h.


The documentation for this class was generated from the following files: