#include <TinyXML.h>
Inherits TiXmlBase, and DigitalSpaces::DIXMLNode1.
Inherited by TiXmlComment, TiXmlDeclaration, TiXmlDocument, TiXmlElement, TiXmlText, and TiXmlUnknown.
(Except for attributes). Nodes have siblings, a parent, and children. A node can be in a document, or stand on its own. The type of a TiXmlNode can be queried, and it can be cast to its more defined type.
Public Types | |
| enum | NodeType { DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, DECLARATION, TYPECOUNT } |
| The types of XML nodes supported by TinyXml. More... | |
Public Member Functions | |
| virtual | ~TiXmlNode () |
| const char * | Value () const |
| The meaning of 'value' changes for the specific type of TiXmlNode. | |
| void | SetValue (const char *_value) |
| Changes the value of the node. | |
| void | Clear () |
| Delete all the children of this node. Does not affect 'this'. | |
| TiXmlNode * | Parent () const |
| One step up the DOM. | |
| TiXmlNode * | FirstChild () const |
| The first child of this node. Will be null if there are no children. | |
| TiXmlNode * | FirstChild (const char *value) const |
| The first child of this node with the matching 'value'. Will be null if none found. | |
| TiXmlNode * | LastChild () const |
| TiXmlNode * | LastChild (const char *value) const |
| The last child of this node. Will be null if there are no children. | |
| TiXmlNode * | IterateChildren (TiXmlNode *previous) const |
| The last child of this node matching 'value'. Will be null if there are no children. | |
| TiXmlNode * | IterateChildren (const char *value, TiXmlNode *previous) const |
| This flavor of IterateChildren searches for children with a particular 'value'. | |
| TiXmlNode * | InsertEndChild (const TiXmlNode &addThis) |
| Add a new node related to this. | |
| TiXmlNode * | LinkEndChild (TiXmlNode *addThis) |
| Add a new node related to this. | |
| TiXmlNode * | InsertBeforeChild (TiXmlNode *beforeThis, const TiXmlNode &addThis) |
| Add a new node related to this. | |
| TiXmlNode * | InsertAfterChild (TiXmlNode *afterThis, const TiXmlNode &addThis) |
| Add a new node related to this. | |
| TiXmlNode * | ReplaceChild (TiXmlNode *replaceThis, const TiXmlNode &withThis) |
| Replace a child of this node. | |
| bool | RemoveChild (TiXmlNode *removeThis) |
| Delete a child of this node. | |
| TiXmlNode * | PreviousSibling () const |
| Navigate to a sibling node. | |
| TiXmlNode * | PreviousSibling (const char *) const |
| Navigate to a sibling node. | |
| TiXmlNode * | NextSibling () const |
| Navigate to a sibling node. | |
| TiXmlNode * | NextSibling (const char *) const |
| Navigate to a sibling node with the given 'value'. | |
| TiXmlElement * | NextSiblingElement () const |
| Convenience function to get through elements. | |
| TiXmlElement * | NextSiblingElement (const char *) const |
| Convenience function to get through elements. | |
| TiXmlElement * | FirstChildElement () const |
| Convenience function to get through elements. | |
| TiXmlElement * | FirstChildElement (const char *value) const |
| Convenience function to get through elements. | |
| virtual int | Type () const |
| Query the type (as an enumerated value, above) of this node. | |
| TiXmlDocument * | GetDocument () const |
| Return a pointer to the Document this node lives in. | |
| bool | NoChildren () const |
| Returns true if this node has no children. | |
| TiXmlDocument * | ToDocument () const |
| Cast to a more defined type. Will return null not of the requested type. | |
| TiXmlElement * | ToElement () const |
| Cast to a more defined type. Will return null not of the requested type. | |
| TiXmlComment * | ToComment () const |
| Cast to a more defined type. Will return null not of the requested type. | |
| TiXmlUnknown * | ToUnknown () const |
| Cast to a more defined type. Will return null not of the requested type. | |
| TiXmlText * | ToText () const |
| Cast to a more defined type. Will return null not of the requested type. | |
| TiXmlDeclaration * | ToDeclaration () const |
| Cast to a more defined type. Will return null not of the requested type. | |
| virtual TiXmlNode * | Clone () const =0 |
| const char * | GetValue () |
| DSS Integration. | |
| DigitalSpaces::DIXMLNode1 * | GetParent () |
| One step up the DOM. | |
| DigitalSpaces::DIXMLNode1 * | GetFirstChild () |
| The first child of this node. Will be null if there are no children. | |
| DigitalSpaces::DIXMLNode1 * | GetFirstChild (const char *value) |
| The first child of this node with the matching 'value'. Will be null if none found. | |
| DigitalSpaces::DIXMLNode1 * | GetLastChild () |
| The last child of this node. Will be null if there are no children. | |
| DigitalSpaces::DIXMLNode1 * | GetLastChild (const char *value) |
| The last child of this node matching 'value'. Will be null if there are no children. | |
| DigitalSpaces::DIXMLNode1 * | _IterateChildren (DigitalSpaces::DIXMLNode1 *previous) |
| The last child of this node matching 'value'. Will be null if there are no children. | |
| DigitalSpaces::DIXMLNode1 * | _IterateChildren (const char *value, DigitalSpaces::DIXMLNode1 *previous) |
| This flavor of IterateChildren searches for children with a particular 'value'. | |
| DigitalSpaces::DIXMLNode1 * | InsertEndChild (const DigitalSpaces::DIXMLNode1 *addThis) |
| Add a new node related to this. | |
| DigitalSpaces::DIXMLNode1 * | _LinkEndChild (DigitalSpaces::DIXMLNode1 *addThis) |
| Add a new node related to this. | |
| DigitalSpaces::DIXMLNode1 * | InsertBeforeChild (DigitalSpaces::DIXMLNode1 *beforeThis, const DigitalSpaces::DIXMLNode1 *addThis) |
| Add a new node related to this. | |
| DigitalSpaces::DIXMLNode1 * | InsertAfterChild (DigitalSpaces::DIXMLNode1 *afterThis, const DigitalSpaces::DIXMLNode1 *addThis) |
| Add a new node related to this. | |
| DigitalSpaces::DIXMLNode1 * | ReplaceChild (DigitalSpaces::DIXMLNode1 *replaceThis, const DigitalSpaces::DIXMLNode1 *withThis) |
| Replace a child of this node. | |
| bool | RemoveChild (DigitalSpaces::DIXMLNode1 *removeThis) |
| Delete a child of this node. | |
| DigitalSpaces::DIXMLNode1 * | GetPreviousSibling () |
| Navigate to a sibling node. | |
| DigitalSpaces::DIXMLNode1 * | GetPreviousSibling (const char *name) |
| Navigate to a sibling node. | |
| DigitalSpaces::DIXMLNode1 * | GetNextSibling () |
| Navigate to a sibling node. | |
| DigitalSpaces::DIXMLNode1 * | GetNextSibling (const char *name) |
| Navigate to a sibling node with the given 'value'. | |
| DigitalSpaces::DIXMLElement1 * | GetNextSiblingElement () |
| Convenience function to get through elements. | |
| DigitalSpaces::DIXMLElement1 * | GetNextSiblingElement (const char *name) |
| Convenience function to get through elements. | |
| DigitalSpaces::DIXMLElement1 * | GetFirstChildElement () |
| Convenience function to get through elements. | |
| DigitalSpaces::DIXMLElement1 * | GetFirstChildElement (const char *value) |
| Convenience function to get through elements. | |
| DigitalSpaces::XMLNodeType | Type () |
| Query the type (as an enumerated value, above) of this node. | |
| bool | NoChildren () |
| Return a pointer to the Document this node lives in. | |
| DigitalSpaces::DIXMLNode1 * | DoClone () |
Protected Member Functions | |
| TiXmlNode (NodeType _type) | |
| TiXmlNode * | Identify (const char *start) |
| void | CopyToClone (TiXmlNode *target) const |
| const TiXmlString & | SValue () const |
Protected Attributes | |
| TiXmlNode * | parent |
| NodeType | type |
| TiXmlNode * | firstChild |
| TiXmlNode * | lastChild |
| TiXmlString | value |
| TiXmlNode * | prev |
| TiXmlNode * | next |
Private Member Functions | |
| TiXmlNode (const TiXmlNode &) | |
| void | operator= (const TiXmlNode &base) |
Friends | |
| class | TiXmlDocument |
| class | TiXmlElement |
| TiXmlOutStream & | operator<< (TiXmlOutStream &out, const TiXmlNode &base) |
| enum TiXmlNode::NodeType |
| virtual TiXmlNode::~TiXmlNode | ( | ) | [virtual] |
| TiXmlNode::TiXmlNode | ( | NodeType | _type | ) | [protected] |
| TiXmlNode::TiXmlNode | ( | const TiXmlNode & | ) | [private] |
| const char* TiXmlNode::Value | ( | ) | const [inline] |
The meaning of 'value' changes for the specific type of TiXmlNode.
Document: filename of the xml file Element: name of the element Comment: the comment text Unknown: the tag contents Text: the text string
The subclasses will wrap this function.
Referenced by GetValue().
| void TiXmlNode::SetValue | ( | const char * | _value | ) | [inline] |
Changes the value of the node.
Defined as:
Document: filename of the xml file Element: name of the element Comment: the comment text Unknown: the tag contents Text: the text string
Reimplemented from DigitalSpaces::DIXMLNode1.
Referenced by CopyToClone(), and TiXmlText::TiXmlText().
| void TiXmlNode::Clear | ( | ) |
Delete all the children of this node. Does not affect 'this'.
Reimplemented from DigitalSpaces::DIXMLNode1.
| TiXmlNode* TiXmlNode::Parent | ( | ) | const [inline] |
| TiXmlNode* TiXmlNode::FirstChild | ( | ) | const [inline] |
| TiXmlNode* TiXmlNode::FirstChild | ( | const char * | value | ) | const |
The first child of this node with the matching 'value'. Will be null if none found.
| TiXmlNode* TiXmlNode::LastChild | ( | ) | const [inline] |
Referenced by GetLastChild().
| TiXmlNode* TiXmlNode::LastChild | ( | const char * | value | ) | const |
The last child of this node. Will be null if there are no children.
The last child of this node matching 'value'. Will be null if there are no children.
An alternate way to walk the children of a node. One way to iterate over nodes is:
for( child = parent->FirstChild(); child; child = child->NextSibling() )
IterateChildren does the same thing with the syntax:
child = 0; while( child = parent->IterateChildren( child ) )
IterateChildren takes the previous child as input and finds the next one. If the previous child is null, it returns the first. IterateChildren will return null when done.
Referenced by _IterateChildren().
This flavor of IterateChildren searches for children with a particular 'value'.
Add a new node related to this.
Adds a child past the LastChild. Returns a pointer to the new object or NULL if an error occured.
Referenced by InsertEndChild().
Add a new node related to this.
Adds a child past the LastChild.
NOTE: the node to be added is passed by pointer, and will be henceforth owned (and deleted) by tinyXml. This method is efficient and avoids an extra copy, but should be used with care as it uses a different memory model than the other insert functions.
Referenced by _LinkEndChild().
Add a new node related to this.
Adds a child before the specified child. Returns a pointer to the new object or NULL if an error occured.
Referenced by InsertBeforeChild().
Add a new node related to this.
Adds a child after the specified child. Returns a pointer to the new object or NULL if an error occured.
Referenced by InsertAfterChild().
Replace a child of this node.
Returns a pointer to the new object or NULL if an error occured.
Referenced by ReplaceChild().
| bool TiXmlNode::RemoveChild | ( | TiXmlNode * | removeThis | ) |
| TiXmlNode* TiXmlNode::PreviousSibling | ( | ) | const [inline] |
| TiXmlNode* TiXmlNode::PreviousSibling | ( | const char * | ) | const |
Navigate to a sibling node.
| TiXmlNode* TiXmlNode::NextSibling | ( | ) | const [inline] |
| TiXmlNode* TiXmlNode::NextSibling | ( | const char * | ) | const |
Navigate to a sibling node with the given 'value'.
| TiXmlElement* TiXmlNode::NextSiblingElement | ( | ) | const |
Convenience function to get through elements.
Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element.
| TiXmlElement* TiXmlNode::NextSiblingElement | ( | const char * | ) | const |
Convenience function to get through elements.
Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element.
| TiXmlElement* TiXmlNode::FirstChildElement | ( | ) | const |
| TiXmlElement* TiXmlNode::FirstChildElement | ( | const char * | value | ) | const |
Convenience function to get through elements.
| virtual int TiXmlNode::Type | ( | ) | const [inline, virtual] |
Query the type (as an enumerated value, above) of this node.
The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION.
| TiXmlDocument* TiXmlNode::GetDocument | ( | ) | const |
Return a pointer to the Document this node lives in.
Returns null if not in a document.
| bool TiXmlNode::NoChildren | ( | ) | const [inline] |
Returns true if this node has no children.
| TiXmlDocument* TiXmlNode::ToDocument | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
| TiXmlElement* TiXmlNode::ToElement | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
Referenced by TiXmlHandle::Element().
| TiXmlComment* TiXmlNode::ToComment | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
| TiXmlUnknown* TiXmlNode::ToUnknown | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
Referenced by TiXmlHandle::Unknown().
| TiXmlText* TiXmlNode::ToText | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
Referenced by TiXmlHandle::Text().
| TiXmlDeclaration* TiXmlNode::ToDeclaration | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
| virtual TiXmlNode* TiXmlNode::Clone | ( | ) | const [pure virtual] |
Implemented in TiXmlElement, TiXmlComment, TiXmlText, TiXmlDeclaration, TiXmlUnknown, and TiXmlDocument.
Referenced by DoClone().
| const char* TiXmlNode::GetValue | ( | ) | [inline] |
| DigitalSpaces::DIXMLNode1* TiXmlNode::GetParent | ( | ) | [inline] |
| DigitalSpaces::DIXMLNode1* TiXmlNode::GetFirstChild | ( | ) | [inline] |
The first child of this node. Will be null if there are no children.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::GetFirstChild | ( | const char * | value | ) | [inline] |
The first child of this node with the matching 'value'. Will be null if none found.
| value | The first child of this node with the matching 'value'. Will be null if none found. |
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::GetLastChild | ( | ) | [inline] |
The last child of this node. Will be null if there are no children.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::GetLastChild | ( | const char * | value | ) | [inline] |
The last child of this node matching 'value'. Will be null if there are no children.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::_IterateChildren | ( | DigitalSpaces::DIXMLNode1 * | previous | ) | [inline] |
The last child of this node matching 'value'. Will be null if there are no children.
An alternate way to walk the children of a node. One way to iterate over nodes is:
for( child = parent->FirstChild( DNoParams ); child; child = child->NextSibling( DNoParams ) )
IterateChildren does the same thing with the syntax:
child DMethodDeclEnd while( child = parent->IterateChildren( child ) )
IterateChildren takes the previous child as input and finds the next one. If the previous child is null, it returns the first. IterateChildren will return null when done.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::_IterateChildren | ( | const char * | value, | |
| DigitalSpaces::DIXMLNode1 * | previous | |||
| ) | [inline] |
This flavor of IterateChildren searches for children with a particular 'value'.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::InsertEndChild | ( | const DigitalSpaces::DIXMLNode1 * | addThis | ) | [inline] |
Add a new node related to this.
Adds a child past the LastChild. Returns a pointer to the new object or NULL if an error occured.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::_LinkEndChild | ( | DigitalSpaces::DIXMLNode1 * | addThis | ) | [inline] |
Add a new node related to this.
Adds a child past the LastChild.
NOTE: the node to be added is passed by pointer, and will be henceforth owned (and deleted) by tinyXml. This method is efficient and avoids an extra copy, but should be used with care as it uses a different memory model than the other insert functions.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::InsertBeforeChild | ( | DigitalSpaces::DIXMLNode1 * | beforeThis, | |
| const DigitalSpaces::DIXMLNode1 * | addThis | |||
| ) | [inline] |
Add a new node related to this.
Adds a child before the specified child. Returns a pointer to the new object or NULL if an error occured.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::InsertAfterChild | ( | DigitalSpaces::DIXMLNode1 * | afterThis, | |
| const DigitalSpaces::DIXMLNode1 * | addThis | |||
| ) | [inline] |
Add a new node related to this.
Adds a child after the specified child. Returns a pointer to the new object or NULL if an error occured.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::ReplaceChild | ( | DigitalSpaces::DIXMLNode1 * | replaceThis, | |
| const DigitalSpaces::DIXMLNode1 * | withThis | |||
| ) | [inline] |
Replace a child of this node.
Returns a pointer to the new object or NULL if an error occured.
Reimplemented from DigitalSpaces::DIXMLNode1.
| bool TiXmlNode::RemoveChild | ( | DigitalSpaces::DIXMLNode1 * | removeThis | ) | [inline] |
| DigitalSpaces::DIXMLNode1* TiXmlNode::GetPreviousSibling | ( | ) | [inline] |
| DigitalSpaces::DIXMLNode1* TiXmlNode::GetPreviousSibling | ( | const char * | name | ) | [inline] |
| DigitalSpaces::DIXMLNode1* TiXmlNode::GetNextSibling | ( | ) | [inline] |
| DigitalSpaces::DIXMLNode1* TiXmlNode::GetNextSibling | ( | const char * | name | ) | [inline] |
| DigitalSpaces::DIXMLElement1* TiXmlNode::GetNextSiblingElement | ( | ) |
Convenience function to get through elements.
Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLElement1* TiXmlNode::GetNextSiblingElement | ( | const char * | name | ) |
Convenience function to get through elements.
Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLElement1* TiXmlNode::GetFirstChildElement | ( | ) |
| DigitalSpaces::DIXMLElement1* TiXmlNode::GetFirstChildElement | ( | const char * | value | ) |
| DigitalSpaces::XMLNodeType TiXmlNode::Type | ( | ) | [inline] |
Query the type (as an enumerated value, above) of this node.
The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION.
Reimplemented from DigitalSpaces::DIXMLNode1.
| bool TiXmlNode::NoChildren | ( | ) | [inline] |
Return a pointer to the Document this node lives in.
Returns null if not in a document. Returns true if this node has no children.
Reimplemented from DigitalSpaces::DIXMLNode1.
| DigitalSpaces::DIXMLNode1* TiXmlNode::DoClone | ( | ) | [inline] |
Reimplemented from DigitalSpaces::DIXMLNode1.
| TiXmlNode* TiXmlNode::Identify | ( | const char * | start | ) | [protected] |
| void TiXmlNode::CopyToClone | ( | TiXmlNode * | target | ) | const [inline, protected] |
| const TiXmlString& TiXmlNode::SValue | ( | ) | const [inline, protected] |
| void TiXmlNode::operator= | ( | const TiXmlNode & | base | ) | [private] |
friend class TiXmlDocument [friend] |
Reimplemented from TiXmlBase.
friend class TiXmlElement [friend] |
| TiXmlOutStream& operator<< | ( | TiXmlOutStream & | out, | |
| const TiXmlNode & | base | |||
| ) | [friend] |
TiXmlNode* TiXmlNode::parent [protected] |
Referenced by Parent().
NodeType TiXmlNode::type [protected] |
Referenced by ToComment(), ToDeclaration(), ToDocument(), ToElement(), ToText(), ToUnknown(), and Type().
TiXmlNode* TiXmlNode::firstChild [protected] |
Referenced by FirstChild(), and NoChildren().
TiXmlNode* TiXmlNode::lastChild [protected] |
Referenced by LastChild().
TiXmlString TiXmlNode::value [protected] |
Referenced by _IterateChildren(), CopyToClone(), GetFirstChild(), GetLastChild(), SetValue(), SValue(), and Value().
TiXmlNode* TiXmlNode::prev [protected] |
Referenced by PreviousSibling().
TiXmlNode* TiXmlNode::next [protected] |
Referenced by NextSibling().
1.5.6