Class XMLNode

#include <Geode/cocos/support/tinyxml2/tinyxml2.h>
classXMLNode{ ... }

XMLNode is a base class for every object that is in the XML Document Object Model (DOM), except XMLAttributes. Nodes have siblings, a parent, and children which can be navigated. A node is always in a XMLDocument. The type of a XMLNode can be queried, and it can be cast to its more defined type. A XMLDocument allocates memory for all its Nodes. When the XMLDocument gets deleted, all its Nodes will also be deleted.

Examples0
Public static methods0
Public member functions45
tinyxml2::XMLDocumentconst*GetDocument()const

/// Get the XMLDocument that owns this XMLNode.

tinyxml2::XMLDocument*GetDocument()

/// Get the XMLDocument that owns this XMLNode.

virtualtinyxml2::XMLElement*ToElement()

/// Safely cast to an Element, or null.

virtualtinyxml2::XMLText*ToText()

/// Safely cast to Text, or null.

virtualtinyxml2::XMLComment*ToComment()

/// Safely cast to a Comment, or null.

virtualtinyxml2::XMLDocument*ToDocument()

/// Safely cast to a Document, or null.

virtualtinyxml2::XMLDeclaration*ToDeclaration()

/// Safely cast to a Declaration, or null.

virtualtinyxml2::XMLUnknown*ToUnknown()

/// Safely cast to an Unknown, or null.

virtualtinyxml2::XMLElementconst*ToElement()const
No description provided
virtualtinyxml2::XMLTextconst*ToText()const
No description provided
virtualtinyxml2::XMLCommentconst*ToComment()const
No description provided
virtualtinyxml2::XMLDocumentconst*ToDocument()const
No description provided
virtualtinyxml2::XMLDeclarationconst*ToDeclaration()const
No description provided
virtualtinyxml2::XMLUnknownconst*ToUnknown()const
No description provided
charconst*Value()const

The meaning of ‘value’ changes for the specific type.

voidSetValue(,
boolstaticMem
)

Set the Value of an XML node.

tinyxml2::XMLNodeconst*Parent()const

/// Get the parent of this node on the DOM.

tinyxml2::XMLNode*Parent()
No description provided
boolNoChildren()const

/// Returns true if this node has no children.

tinyxml2::XMLNodeconst*FirstChild()const

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

tinyxml2::XMLNode*FirstChild()
No description provided
tinyxml2::XMLElementconst*FirstChildElement()const

Get the first child element, or optionally the first child element with the specified name.

tinyxml2::XMLElement*FirstChildElement()
No description provided
tinyxml2::XMLNodeconst*LastChild()const

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

tinyxml2::XMLNode*LastChild()
No description provided
tinyxml2::XMLElementconst*LastChildElement()const

Get the last child element or optionally the last child element with the specified name.

tinyxml2::XMLElement*LastChildElement()
No description provided
tinyxml2::XMLNodeconst*PreviousSibling()const

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

tinyxml2::XMLNode*PreviousSibling()
No description provided
tinyxml2::XMLElementconst*PreviousSiblingElement()const

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

tinyxml2::XMLElement*PreviousSiblingElement()
No description provided
tinyxml2::XMLNodeconst*NextSibling()const

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

tinyxml2::XMLNode*NextSibling()
No description provided
tinyxml2::XMLElementconst*NextSiblingElement()const

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

tinyxml2::XMLElement*NextSiblingElement()
No description provided
tinyxml2::XMLNode*InsertEndChild()

Add a child node as the last (right) child.

tinyxml2::XMLNode*LinkEndChild()
No description provided
tinyxml2::XMLNode*InsertFirstChild()

Add a child node as the first (left) child.

tinyxml2::XMLNode*InsertAfterChild(,)

Add a node after the specified child node.

voidDeleteChildren()

Delete all the children of this node.

voidDeleteChild()

Delete a child of this node.

virtualtinyxml2::XMLNode*ShallowClone()const=0

Make a copy of this node, but not its children. You may pass in a Document pointer that will be the owner of the new Node. If the ‘document’ is null, then the node returned will be allocated from the current Document. (this->GetDocument()) Note: if called on a XMLDocument, this will return null.

virtualboolShallowEqual()const=0

Test if 2 nodes are the same, but don’t test children. The 2 nodes do not need to be in the same Document. Note: if called on a XMLDocument, this will return false.

virtualboolAccept()const=0

Accept a hierarchical visit of the nodes in the TinyXML DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the TiXmlVisitor interface. This is essentially a SAX interface for TinyXML. (Note however it doesn’t re-parse the XML for the callbacks, so the performance of TinyXML is unchanged by using this interface versus any other.) The interface has been based on ideas from:

  • http://www.saxproject.org/
  • http://c2.com/cgi/wiki?HierarchicalVisitorPattern Which are both good references for “visiting”. An example of using Accept():
virtualchar*ParseDeep(,)
No description provided
Fields0
Protected member functions1
tinyxml2::XMLNode&operator=()
No description provided
Protected fields7
;
No description provided
;
No description provided
;
No description provided
;
No description provided
;
No description provided
;
No description provided
;
No description provided