The parent class for everything in the Document Object Model. More...
#include <OBTtinyxml.h>
Public Types | |
enum | NodeType { DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, DECLARATION, TYPECOUNT, DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, DECLARATION, TYPECOUNT } |
The types of XML nodes supported by TinyXml. More... | |
enum | NodeType { DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, DECLARATION, TYPECOUNT, 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. | |
const TIXML_STRING & | ValueTStr () const |
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 () |
One step up the DOM. | |
const TiXmlNode * | Parent () const |
const TiXmlNode * | FirstChild () const |
The first child of this node. Will be null if there are no children. | |
TiXmlNode * | FirstChild () |
const TiXmlNode * | FirstChild (const char *value) const |
The first child of this node with the matching 'value'. | |
TiXmlNode * | FirstChild (const char *_value) |
The first child of this node with the matching 'value'. Will be null if none found. | |
const TiXmlNode * | LastChild () const |
TiXmlNode * | LastChild () |
The last child of this node. Will be null if there are no children. | |
const TiXmlNode * | LastChild (const char *value) const |
TiXmlNode * | LastChild (const char *_value) |
The last child of this node matching 'value'. Will be null if there are no children. | |
const TiXmlNode * | IterateChildren (const TiXmlNode *previous) const |
An alternate way to walk the children of a node. | |
TiXmlNode * | IterateChildren (const TiXmlNode *previous) |
const TiXmlNode * | IterateChildren (const char *value, const TiXmlNode *previous) const |
This flavor of IterateChildren searches for children with a particular 'value'. | |
TiXmlNode * | IterateChildren (const char *_value, const TiXmlNode *previous) |
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. | |
const TiXmlNode * | PreviousSibling () const |
Navigate to a sibling node. | |
TiXmlNode * | PreviousSibling () |
const TiXmlNode * | PreviousSibling (const char *) const |
Navigate to a sibling node. | |
TiXmlNode * | PreviousSibling (const char *_prev) |
const TiXmlNode * | NextSibling () const |
Navigate to a sibling node. | |
TiXmlNode * | NextSibling () |
const TiXmlNode * | NextSibling (const char *) const |
Navigate to a sibling node with the given 'value'. | |
TiXmlNode * | NextSibling (const char *_next) |
const TiXmlElement * | NextSiblingElement () const |
Convenience function to get through elements. | |
TiXmlElement * | NextSiblingElement () |
const TiXmlElement * | NextSiblingElement (const char *) const |
Convenience function to get through elements. | |
TiXmlElement * | NextSiblingElement (const char *_next) |
const TiXmlElement * | FirstChildElement () const |
Convenience function to get through elements. | |
TiXmlElement * | FirstChildElement () |
const TiXmlElement * | FirstChildElement (const char *_value) const |
Convenience function to get through elements. | |
TiXmlElement * | FirstChildElement (const char *_value) |
int | Type () const |
Query the type (as an enumerated value, above) of this node. | |
const TiXmlDocument * | GetDocument () const |
Return a pointer to the Document this node lives in. | |
TiXmlDocument * | GetDocument () |
bool | NoChildren () const |
Returns true if this node has no children. | |
virtual const TiXmlDocument * | ToDocument () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual const TiXmlElement * | ToElement () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual const TiXmlComment * | ToComment () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual const TiXmlUnknown * | ToUnknown () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual const TiXmlText * | ToText () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual const TiXmlDeclaration * | ToDeclaration () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlDocument * | ToDocument () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlElement * | ToElement () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlComment * | ToComment () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlUnknown * | ToUnknown () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlText * | ToText () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlDeclaration * | ToDeclaration () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlNode * | Clone () const =0 |
Create an exact duplicate of this node and return it. | |
virtual bool | Accept (TiXmlVisitor *visitor) const =0 |
Accept a hierchical visit the nodes in the TinyXML DOM. | |
virtual | ~TiXmlNode () |
const char * | Value () const |
The meaning of 'value' changes for the specific type of TiXmlNode. | |
const TIXML_STRING & | ValueTStr () const |
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 () |
One step up the DOM. | |
const TiXmlNode * | Parent () const |
const TiXmlNode * | FirstChild () const |
The first child of this node. Will be null if there are no children. | |
TiXmlNode * | FirstChild () |
const TiXmlNode * | FirstChild (const char *value) const |
The first child of this node with the matching 'value'. | |
TiXmlNode * | FirstChild (const char *_value) |
The first child of this node with the matching 'value'. Will be null if none found. | |
const TiXmlNode * | LastChild () const |
TiXmlNode * | LastChild () |
The last child of this node. Will be null if there are no children. | |
const TiXmlNode * | LastChild (const char *value) const |
TiXmlNode * | LastChild (const char *_value) |
The last child of this node matching 'value'. Will be null if there are no children. | |
const TiXmlNode * | IterateChildren (const TiXmlNode *previous) const |
An alternate way to walk the children of a node. | |
TiXmlNode * | IterateChildren (const TiXmlNode *previous) |
const TiXmlNode * | IterateChildren (const char *value, const TiXmlNode *previous) const |
This flavor of IterateChildren searches for children with a particular 'value'. | |
TiXmlNode * | IterateChildren (const char *_value, const TiXmlNode *previous) |
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. | |
const TiXmlNode * | PreviousSibling () const |
Navigate to a sibling node. | |
TiXmlNode * | PreviousSibling () |
const TiXmlNode * | PreviousSibling (const char *) const |
Navigate to a sibling node. | |
TiXmlNode * | PreviousSibling (const char *_prev) |
const TiXmlNode * | NextSibling () const |
Navigate to a sibling node. | |
TiXmlNode * | NextSibling () |
const TiXmlNode * | NextSibling (const char *) const |
Navigate to a sibling node with the given 'value'. | |
TiXmlNode * | NextSibling (const char *_next) |
const TiXmlElement * | NextSiblingElement () const |
Convenience function to get through elements. | |
TiXmlElement * | NextSiblingElement () |
const TiXmlElement * | NextSiblingElement (const char *) const |
Convenience function to get through elements. | |
TiXmlElement * | NextSiblingElement (const char *_next) |
const TiXmlElement * | FirstChildElement () const |
Convenience function to get through elements. | |
TiXmlElement * | FirstChildElement () |
const TiXmlElement * | FirstChildElement (const char *_value) const |
Convenience function to get through elements. | |
TiXmlElement * | FirstChildElement (const char *_value) |
int | Type () const |
Query the type (as an enumerated value, above) of this node. | |
const TiXmlDocument * | GetDocument () const |
Return a pointer to the Document this node lives in. | |
TiXmlDocument * | GetDocument () |
bool | NoChildren () const |
Returns true if this node has no children. | |
virtual const TiXmlDocument * | ToDocument () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual const TiXmlElement * | ToElement () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual const TiXmlComment * | ToComment () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual const TiXmlUnknown * | ToUnknown () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual const TiXmlText * | ToText () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual const TiXmlDeclaration * | ToDeclaration () const |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlDocument * | ToDocument () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlElement * | ToElement () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlComment * | ToComment () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlUnknown * | ToUnknown () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlText * | ToText () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlDeclaration * | ToDeclaration () |
Cast to a more defined type. Will return null if not of the requested type. | |
virtual TiXmlNode * | Clone () const =0 |
Create an exact duplicate of this node and return it. | |
virtual bool | Accept (TiXmlVisitor *visitor) const =0 |
Accept a hierchical visit the nodes in the TinyXML DOM. | |
Protected Member Functions | |
TiXmlNode (NodeType _type) | |
void | CopyTo (TiXmlNode *target) const |
TiXmlNode * | Identify (const char *start, TiXmlEncoding encoding) |
TiXmlNode (NodeType _type) | |
void | CopyTo (TiXmlNode *target) const |
TiXmlNode * | Identify (const char *start, TiXmlEncoding encoding) |
Protected Attributes | |
TiXmlNode * | parent |
NodeType | type |
TiXmlNode * | firstChild |
TiXmlNode * | lastChild |
TIXML_STRING | value |
TiXmlNode * | prev |
TiXmlNode * | next |
Private Member Functions | |
TiXmlNode (const TiXmlNode &) | |
void | operator= (const TiXmlNode &base) |
TiXmlNode (const TiXmlNode &) | |
void | operator= (const TiXmlNode &base) |
Friends | |
class | TiXmlDocument |
class | TiXmlElement |
The parent class for everything in the Document Object Model.
(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.
Definition at line 432 of file OBTtinyxml.h.
The types of XML nodes supported by TinyXml.
(All the unsupported types are picked up by UNKNOWN.)
DOCUMENT | |
ELEMENT | |
COMMENT | |
UNKNOWN | |
TEXT | |
DECLARATION | |
TYPECOUNT | |
DOCUMENT | |
ELEMENT | |
COMMENT | |
UNKNOWN | |
TEXT | |
DECLARATION | |
TYPECOUNT |
Definition at line 470 of file tiny/OBTtinyxml.h.
The types of XML nodes supported by TinyXml.
(All the unsupported types are picked up by UNKNOWN.)
DOCUMENT | |
ELEMENT | |
COMMENT | |
UNKNOWN | |
TEXT | |
DECLARATION | |
TYPECOUNT | |
DOCUMENT | |
ELEMENT | |
COMMENT | |
UNKNOWN | |
TEXT | |
DECLARATION | |
TYPECOUNT |
Definition at line 471 of file OBTtinyxml.h.
OBT::TiXmlNode::~TiXmlNode | ( | ) | [virtual] |
Definition at line 148 of file OBTtinyxml.cpp.
References firstChild, and next.
00149 { 00150 TiXmlNode* node = firstChild; 00151 TiXmlNode* temp = 0; 00152 00153 while ( node ) 00154 { 00155 temp = node; 00156 node = node->next; 00157 delete temp; 00158 } 00159 }
OBT::TiXmlNode::TiXmlNode | ( | NodeType | _type | ) | [protected] |
Definition at line 137 of file OBTtinyxml.cpp.
References firstChild, lastChild, next, parent, prev, and type.
OBT::TiXmlNode::TiXmlNode | ( | const TiXmlNode & | ) | [private] |
virtual OBT::TiXmlNode::~TiXmlNode | ( | ) | [virtual] |
OBT::TiXmlNode::TiXmlNode | ( | NodeType | _type | ) | [protected] |
OBT::TiXmlNode::TiXmlNode | ( | const TiXmlNode & | ) | [private] |
virtual bool OBT::TiXmlNode::Accept | ( | TiXmlVisitor * | visitor | ) | const [pure virtual] |
Accept a hierchical visit 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:
Which are both good references for "visiting".
An example of using Accept():
TiXmlPrinter printer; tinyxmlDoc.Accept( &printer ); const char* xmlcstr = printer.CStr();
Implemented in OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, OBT::TiXmlDocument, OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, and OBT::TiXmlDocument.
virtual bool OBT::TiXmlNode::Accept | ( | TiXmlVisitor * | visitor | ) | const [pure virtual] |
Accept a hierchical visit 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:
Which are both good references for "visiting".
An example of using Accept():
TiXmlPrinter printer; tinyxmlDoc.Accept( &printer ); const char* xmlcstr = printer.CStr();
Implemented in OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, OBT::TiXmlDocument, OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, and OBT::TiXmlDocument.
void OBT::TiXmlNode::Clear | ( | ) |
Delete all the children of this node. Does not affect 'this'.
void OBT::TiXmlNode::Clear | ( | ) |
Delete all the children of this node. Does not affect 'this'.
Definition at line 169 of file OBTtinyxml.cpp.
References firstChild, lastChild, and next.
Referenced by OBT::TiXmlElement::ClearThis(), OBT::TiXmlDocument::LoadFile(), OBT::main(), OBT::TiXmlDeclaration::operator=(), OBT::TiXmlComment::operator=(), and OBT::TiXmlDocument::operator=().
00170 { 00171 TiXmlNode* node = firstChild; 00172 TiXmlNode* temp = 0; 00173 00174 while ( node ) 00175 { 00176 temp = node; 00177 node = node->next; 00178 delete temp; 00179 } 00180 00181 firstChild = 0; 00182 lastChild = 0; 00183 }
virtual TiXmlNode* OBT::TiXmlNode::Clone | ( | ) | const [pure virtual] |
Create an exact duplicate of this node and return it.
The memory must be deleted by the caller.
Implemented in OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, OBT::TiXmlDocument, OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, and OBT::TiXmlDocument.
virtual TiXmlNode* OBT::TiXmlNode::Clone | ( | ) | const [pure virtual] |
Create an exact duplicate of this node and return it.
The memory must be deleted by the caller.
Implemented in OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, OBT::TiXmlDocument, OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, and OBT::TiXmlDocument.
Referenced by OBT::TiXmlDocument::CopyTo(), OBT::TiXmlElement::CopyTo(), InsertAfterChild(), InsertBeforeChild(), InsertEndChild(), and ReplaceChild().
void OBT::TiXmlNode::CopyTo | ( | TiXmlNode * | target | ) | const [protected] |
void OBT::TiXmlNode::CopyTo | ( | TiXmlNode * | target | ) | const [protected] |
Reimplemented in OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, OBT::TiXmlDocument, OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, and OBT::TiXmlDocument.
Definition at line 162 of file OBTtinyxml.cpp.
References setValue(), OBT::TiXmlBase::userData, and value.
TiXmlNode* OBT::TiXmlNode::FirstChild | ( | const char * | _value | ) | [inline] |
The first child of this node with the matching 'value'. Will be null if none found.
Definition at line 534 of file tiny/OBTtinyxml.h.
00534 { 00535 // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe) 00536 // call the method, cast the return back to non-const. 00537 return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value )); 00538 }
const TiXmlNode* OBT::TiXmlNode::FirstChild | ( | const char * | value | ) | const |
The first child of this node with the matching 'value'.
Will be null if none found.
TiXmlNode* OBT::TiXmlNode::FirstChild | ( | ) | [inline] |
Definition at line 531 of file tiny/OBTtinyxml.h.
References firstChild.
00531 { return firstChild; }
const TiXmlNode* OBT::TiXmlNode::FirstChild | ( | ) | const [inline] |
The first child of this node. Will be null if there are no children.
Definition at line 530 of file tiny/OBTtinyxml.h.
References firstChild.
TiXmlNode* OBT::TiXmlNode::FirstChild | ( | const char * | _value | ) | [inline] |
The first child of this node with the matching 'value'. Will be null if none found.
Definition at line 535 of file OBTtinyxml.h.
00535 { 00536 // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe) 00537 // call the method, cast the return back to non-const. 00538 return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value )); 00539 }
const TiXmlNode * OBT::TiXmlNode::FirstChild | ( | const char * | value | ) | const |
The first child of this node with the matching 'value'.
Will be null if none found.
Definition at line 342 of file OBTtinyxml.cpp.
References firstChild, next, and Value().
00343 { 00344 const TiXmlNode* node; 00345 for ( node = firstChild; node; node = node->next ) 00346 { 00347 if ( strcmp( node->Value(), _value ) == 0 ) 00348 return node; 00349 } 00350 return 0; 00351 }
TiXmlNode* OBT::TiXmlNode::FirstChild | ( | ) | [inline] |
Definition at line 532 of file OBTtinyxml.h.
00532 { return firstChild; }
const TiXmlNode* OBT::TiXmlNode::FirstChild | ( | ) | const [inline] |
The first child of this node. Will be null if there are no children.
Definition at line 531 of file OBTtinyxml.h.
Referenced by OBT::TiXmlDocument::Accept(), OBT::TiXmlElement::Accept(), FirstChildElement(), OBT::TiXmlElement::GetText(), IterateChildren(), OBT::main(), OBT::TiXmlDocument::Print(), OBT::TiXmlPrinter::VisitEnter(), and OBT::TiXmlPrinter::VisitExit().
TiXmlElement* OBT::TiXmlNode::FirstChildElement | ( | const char * | _value | ) | [inline] |
Definition at line 679 of file tiny/OBTtinyxml.h.
00679 { 00680 return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) ); 00681 }
const TiXmlElement* OBT::TiXmlNode::FirstChildElement | ( | const char * | _value | ) | const |
Convenience function to get through elements.
TiXmlElement* OBT::TiXmlNode::FirstChildElement | ( | ) | [inline] |
Definition at line 673 of file tiny/OBTtinyxml.h.
00673 { 00674 return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() ); 00675 }
const TiXmlElement* OBT::TiXmlNode::FirstChildElement | ( | ) | const |
Convenience function to get through elements.
TiXmlElement* OBT::TiXmlNode::FirstChildElement | ( | const char * | _value | ) | [inline] |
Definition at line 680 of file OBTtinyxml.h.
00680 { 00681 return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) ); 00682 }
const TiXmlElement * OBT::TiXmlNode::FirstChildElement | ( | const char * | _value | ) | const |
Convenience function to get through elements.
Definition at line 448 of file OBTtinyxml.cpp.
References FirstChild(), NextSibling(), and ToElement().
00449 { 00450 const TiXmlNode* node; 00451 00452 for ( node = FirstChild( _value ); 00453 node; 00454 node = node->NextSibling( _value ) ) 00455 { 00456 if ( node->ToElement() ) 00457 return node->ToElement(); 00458 } 00459 return 0; 00460 }
TiXmlElement* OBT::TiXmlNode::FirstChildElement | ( | ) | [inline] |
Definition at line 674 of file OBTtinyxml.h.
00674 { 00675 return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() ); 00676 }
const TiXmlElement * OBT::TiXmlNode::FirstChildElement | ( | ) | const |
Convenience function to get through elements.
Definition at line 433 of file OBTtinyxml.cpp.
References FirstChild(), NextSibling(), and ToElement().
Referenced by OBT::XMLConfigurationFileParser::AddChildren(), OBT::main(), and OBT::TiXmlDocument::RootElement().
00434 { 00435 const TiXmlNode* node; 00436 00437 for ( node = FirstChild(); 00438 node; 00439 node = node->NextSibling() ) 00440 { 00441 if ( node->ToElement() ) 00442 return node->ToElement(); 00443 } 00444 return 0; 00445 }
TiXmlDocument* OBT::TiXmlNode::GetDocument | ( | ) | [inline] |
Definition at line 698 of file tiny/OBTtinyxml.h.
00698 { 00699 return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() ); 00700 }
const TiXmlDocument* OBT::TiXmlNode::GetDocument | ( | ) | const |
Return a pointer to the Document this node lives in.
Returns null if not in a document.
TiXmlDocument* OBT::TiXmlNode::GetDocument | ( | ) | [inline] |
Definition at line 699 of file OBTtinyxml.h.
00699 { 00700 return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() ); 00701 }
const TiXmlDocument * OBT::TiXmlNode::GetDocument | ( | ) | const |
Return a pointer to the Document this node lives in.
Returns null if not in a document.
Definition at line 493 of file OBTtinyxml.cpp.
References parent, and ToDocument().
Referenced by Identify(), InsertAfterChild(), InsertBeforeChild(), InsertEndChild(), LinkEndChild(), OBT::TiXmlDeclaration::Parse(), OBT::TiXmlText::Parse(), OBT::TiXmlComment::Parse(), OBT::TiXmlUnknown::Parse(), OBT::TiXmlElement::Parse(), OBT::TiXmlElement::ReadValue(), and OBT::TiXmlElement::SetAttribute().
00494 { 00495 const TiXmlNode* node; 00496 00497 for( node = this; node; node = node->parent ) 00498 { 00499 if ( node->ToDocument() ) 00500 return node->ToDocument(); 00501 } 00502 return 0; 00503 }
TiXmlNode* OBT::TiXmlNode::Identify | ( | const char * | start, | |
TiXmlEncoding | encoding | |||
) | [protected] |
TiXmlNode * OBT::TiXmlNode::Identify | ( | const char * | start, | |
TiXmlEncoding | encoding | |||
) | [protected] |
Definition at line 820 of file OBTtinyxmlparser.cpp.
References GetDocument(), OBT::TiXmlBase::IsAlpha(), parent, OBT::TiXmlText::SetCDATA(), OBT::TiXmlDocument::SetError(), OBT::TiXmlBase::SkipWhiteSpace(), OBT::TiXmlBase::StringEqual(), OBT::TIXML_ENCODING_UNKNOWN, OBT::TiXmlBase::TIXML_ERROR_OUT_OF_MEMORY, and TiXmlElement.
Referenced by OBT::TiXmlDocument::Parse(), and OBT::TiXmlElement::ReadValue().
00821 { 00822 TiXmlNode* returnNode = 0; 00823 00824 p = SkipWhiteSpace( p, encoding ); 00825 if( !p || !*p || *p != '<' ) 00826 { 00827 return 0; 00828 } 00829 00830 TiXmlDocument* doc = GetDocument(); 00831 p = SkipWhiteSpace( p, encoding ); 00832 00833 if ( !p || !*p ) 00834 { 00835 return 0; 00836 } 00837 00838 // What is this thing? 00839 // - Elements start with a letter or underscore, but xml is reserved. 00840 // - Comments: <!-- 00841 // - Decleration: <?xml 00842 // - Everthing else is unknown to tinyxml. 00843 // 00844 00845 const char* xmlHeader = { "<?xml" }; 00846 const char* commentHeader = { "<!--" }; 00847 const char* dtdHeader = { "<!" }; 00848 const char* cdataHeader = { "<![CDATA[" }; 00849 00850 if ( StringEqual( p, xmlHeader, true, encoding ) ) 00851 { 00852 #ifdef DEBUG_PARSER 00853 TIXML_LOG( "XML parsing Declaration\n" ); 00854 #endif 00855 returnNode = new TiXmlDeclaration(); 00856 } 00857 else if ( StringEqual( p, commentHeader, false, encoding ) ) 00858 { 00859 #ifdef DEBUG_PARSER 00860 TIXML_LOG( "XML parsing Comment\n" ); 00861 #endif 00862 returnNode = new TiXmlComment(); 00863 } 00864 else if ( StringEqual( p, cdataHeader, false, encoding ) ) 00865 { 00866 #ifdef DEBUG_PARSER 00867 TIXML_LOG( "XML parsing CDATA\n" ); 00868 #endif 00869 TiXmlText* text = new TiXmlText( "" ); 00870 text->SetCDATA( true ); 00871 returnNode = text; 00872 } 00873 else if ( StringEqual( p, dtdHeader, false, encoding ) ) 00874 { 00875 #ifdef DEBUG_PARSER 00876 TIXML_LOG( "XML parsing Unknown(1)\n" ); 00877 #endif 00878 returnNode = new TiXmlUnknown(); 00879 } 00880 else if ( IsAlpha( *(p+1), encoding ) 00881 || *(p+1) == '_' ) 00882 { 00883 #ifdef DEBUG_PARSER 00884 TIXML_LOG( "XML parsing Element\n" ); 00885 #endif 00886 returnNode = new TiXmlElement( "" ); 00887 } 00888 else 00889 { 00890 #ifdef DEBUG_PARSER 00891 TIXML_LOG( "XML parsing Unknown(2)\n" ); 00892 #endif 00893 returnNode = new TiXmlUnknown(); 00894 } 00895 00896 if ( returnNode ) 00897 { 00898 // Set the parent, so it can report errors 00899 returnNode->parent = this; 00900 } 00901 else 00902 { 00903 if ( doc ) 00904 doc->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); 00905 } 00906 return returnNode; 00907 }
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.
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.
Definition at line 260 of file OBTtinyxml.cpp.
References Clone(), DOCUMENT, GetDocument(), lastChild, next, parent, prev, OBT::TiXmlDocument::SetError(), OBT::TIXML_ENCODING_UNKNOWN, OBT::TiXmlBase::TIXML_ERROR_DOCUMENT_TOP_ONLY, and Type().
Referenced by OBT::main().
00261 { 00262 if ( !afterThis || afterThis->parent != this ) { 00263 return 0; 00264 } 00265 if ( addThis.Type() == TiXmlNode::DOCUMENT ) 00266 { 00267 if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); 00268 return 0; 00269 } 00270 00271 TiXmlNode* node = addThis.Clone(); 00272 if ( !node ) 00273 return 0; 00274 node->parent = this; 00275 00276 node->prev = afterThis; 00277 node->next = afterThis->next; 00278 if ( afterThis->next ) 00279 { 00280 afterThis->next->prev = node; 00281 } 00282 else 00283 { 00284 assert( lastChild == afterThis ); 00285 lastChild = node; 00286 } 00287 afterThis->next = node; 00288 return node; 00289 }
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.
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.
Definition at line 228 of file OBTtinyxml.cpp.
References Clone(), DOCUMENT, firstChild, GetDocument(), next, parent, prev, OBT::TiXmlDocument::SetError(), OBT::TIXML_ENCODING_UNKNOWN, OBT::TiXmlBase::TIXML_ERROR_DOCUMENT_TOP_ONLY, and Type().
Referenced by OBT::main().
00229 { 00230 if ( !beforeThis || beforeThis->parent != this ) { 00231 return 0; 00232 } 00233 if ( addThis.Type() == TiXmlNode::DOCUMENT ) 00234 { 00235 if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); 00236 return 0; 00237 } 00238 00239 TiXmlNode* node = addThis.Clone(); 00240 if ( !node ) 00241 return 0; 00242 node->parent = this; 00243 00244 node->next = beforeThis; 00245 node->prev = beforeThis->prev; 00246 if ( beforeThis->prev ) 00247 { 00248 beforeThis->prev->next = node; 00249 } 00250 else 00251 { 00252 assert( firstChild == beforeThis ); 00253 firstChild = node; 00254 } 00255 beforeThis->prev = node; 00256 return node; 00257 }
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.
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.
Definition at line 213 of file OBTtinyxml.cpp.
References Clone(), DOCUMENT, GetDocument(), LinkEndChild(), OBT::TiXmlDocument::SetError(), OBT::TIXML_ENCODING_UNKNOWN, OBT::TiXmlBase::TIXML_ERROR_DOCUMENT_TOP_ONLY, and Type().
Referenced by OBT::main().
00214 { 00215 if ( addThis.Type() == TiXmlNode::DOCUMENT ) 00216 { 00217 if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); 00218 return 0; 00219 } 00220 TiXmlNode* node = addThis.Clone(); 00221 if ( !node ) 00222 return 0; 00223 00224 return LinkEndChild( node ); 00225 }
TiXmlNode* OBT::TiXmlNode::IterateChildren | ( | const char * | _value, | |
const TiXmlNode * | previous | |||
) | [inline] |
Definition at line 577 of file tiny/OBTtinyxml.h.
const TiXmlNode* OBT::TiXmlNode::IterateChildren | ( | const char * | value, | |
const TiXmlNode * | previous | |||
) | const |
This flavor of IterateChildren searches for children with a particular 'value'.
Definition at line 571 of file tiny/OBTtinyxml.h.
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.
TiXmlNode* OBT::TiXmlNode::IterateChildren | ( | const char * | _value, | |
const TiXmlNode * | previous | |||
) | [inline] |
Definition at line 578 of file OBTtinyxml.h.
const TiXmlNode * OBT::TiXmlNode::IterateChildren | ( | const char * | value, | |
const TiXmlNode * | previous | |||
) | const |
This flavor of IterateChildren searches for children with a particular 'value'.
Definition at line 380 of file OBTtinyxml.cpp.
References FirstChild(), NextSibling(), and parent.
00381 { 00382 if ( !previous ) 00383 { 00384 return FirstChild( val ); 00385 } 00386 else 00387 { 00388 assert( previous->parent == this ); 00389 return previous->NextSibling( val ); 00390 } 00391 }
Definition at line 572 of file OBTtinyxml.h.
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.
Definition at line 366 of file OBTtinyxml.cpp.
References FirstChild(), NextSibling(), and parent.
00367 { 00368 if ( !previous ) 00369 { 00370 return FirstChild(); 00371 } 00372 else 00373 { 00374 assert( previous->parent == this ); 00375 return previous->NextSibling(); 00376 } 00377 }
TiXmlNode* OBT::TiXmlNode::LastChild | ( | const char * | _value | ) | [inline] |
The last child of this node matching 'value'. Will be null if there are no children.
Definition at line 543 of file tiny/OBTtinyxml.h.
const TiXmlNode* OBT::TiXmlNode::LastChild | ( | const char * | value | ) | const |
TiXmlNode* OBT::TiXmlNode::LastChild | ( | ) | [inline] |
The last child of this node. Will be null if there are no children.
Definition at line 540 of file tiny/OBTtinyxml.h.
References lastChild.
00540 { return lastChild; }
const TiXmlNode* OBT::TiXmlNode::LastChild | ( | ) | const [inline] |
TiXmlNode* OBT::TiXmlNode::LastChild | ( | const char * | _value | ) | [inline] |
The last child of this node matching 'value'. Will be null if there are no children.
Definition at line 544 of file OBTtinyxml.h.
const TiXmlNode * OBT::TiXmlNode::LastChild | ( | const char * | value | ) | const |
TiXmlNode* OBT::TiXmlNode::LastChild | ( | ) | [inline] |
The last child of this node. Will be null if there are no children.
Definition at line 541 of file OBTtinyxml.h.
00541 { return lastChild; }
const TiXmlNode* OBT::TiXmlNode::LastChild | ( | ) | const [inline] |
Definition at line 540 of file OBTtinyxml.h.
Referenced by OBT::main(), and OBT::TiXmlPrinter::VisitEnter().
00540 { return lastChild; }
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.
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.
Definition at line 186 of file OBTtinyxml.cpp.
References DOCUMENT, firstChild, GetDocument(), lastChild, next, parent, prev, OBT::TiXmlDocument::SetError(), OBT::TIXML_ENCODING_UNKNOWN, OBT::TiXmlBase::TIXML_ERROR_DOCUMENT_TOP_ONLY, and Type().
Referenced by OBT::TiXmlDocument::CopyTo(), OBT::TiXmlElement::CopyTo(), InsertEndChild(), OBT::TiXmlDocument::Parse(), and OBT::TiXmlElement::ReadValue().
00187 { 00188 assert( node->parent == 0 || node->parent == this ); 00189 assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() ); 00190 00191 if ( node->Type() == TiXmlNode::DOCUMENT ) 00192 { 00193 delete node; 00194 if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); 00195 return 0; 00196 } 00197 00198 node->parent = this; 00199 00200 node->prev = lastChild; 00201 node->next = 0; 00202 00203 if ( lastChild ) 00204 lastChild->next = node; 00205 else 00206 firstChild = node; // it was an empty list. 00207 00208 lastChild = node; 00209 return node; 00210 }
TiXmlNode* OBT::TiXmlNode::NextSibling | ( | const char * | _next | ) | [inline] |
Definition at line 644 of file tiny/OBTtinyxml.h.
const TiXmlNode* OBT::TiXmlNode::NextSibling | ( | const char * | ) | const |
Navigate to a sibling node with the given 'value'.
TiXmlNode* OBT::TiXmlNode::NextSibling | ( | ) | [inline] |
const TiXmlNode* OBT::TiXmlNode::NextSibling | ( | ) | const [inline] |
Navigate to a sibling node.
Definition at line 639 of file tiny/OBTtinyxml.h.
References next.
00639 { return next; }
TiXmlNode* OBT::TiXmlNode::NextSibling | ( | const char * | _next | ) | [inline] |
Definition at line 645 of file OBTtinyxml.h.
const TiXmlNode * OBT::TiXmlNode::NextSibling | ( | const char * | _value | ) | const |
Navigate to a sibling node with the given 'value'.
Definition at line 394 of file OBTtinyxml.cpp.
TiXmlNode* OBT::TiXmlNode::NextSibling | ( | ) | [inline] |
Definition at line 641 of file OBTtinyxml.h.
00641 { return next; }
const TiXmlNode* OBT::TiXmlNode::NextSibling | ( | ) | const [inline] |
Navigate to a sibling node.
Definition at line 640 of file OBTtinyxml.h.
Referenced by OBT::TiXmlHandle::Child(), OBT::TiXmlDocument::CopyTo(), OBT::TiXmlElement::CopyTo(), FirstChildElement(), IterateChildren(), OBT::main(), NextSiblingElement(), and OBT::TiXmlElement::Print().
00640 { return next; }
TiXmlElement* OBT::TiXmlNode::NextSiblingElement | ( | const char * | _next | ) | [inline] |
Definition at line 662 of file tiny/OBTtinyxml.h.
00662 { 00663 return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) ); 00664 }
const TiXmlElement* OBT::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* OBT::TiXmlNode::NextSiblingElement | ( | ) | [inline] |
Definition at line 653 of file tiny/OBTtinyxml.h.
00653 { 00654 return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() ); 00655 }
const TiXmlElement* OBT::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* OBT::TiXmlNode::NextSiblingElement | ( | const char * | _next | ) | [inline] |
Definition at line 663 of file OBTtinyxml.h.
00663 { 00664 return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) ); 00665 }
const TiXmlElement * OBT::TiXmlNode::NextSiblingElement | ( | const char * | _value | ) | 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.
Definition at line 478 of file OBTtinyxml.cpp.
References NextSibling(), and ToElement().
00479 { 00480 const TiXmlNode* node; 00481 00482 for ( node = NextSibling( _value ); 00483 node; 00484 node = node->NextSibling( _value ) ) 00485 { 00486 if ( node->ToElement() ) 00487 return node->ToElement(); 00488 } 00489 return 0; 00490 }
TiXmlElement* OBT::TiXmlNode::NextSiblingElement | ( | ) | [inline] |
Definition at line 654 of file OBTtinyxml.h.
00654 { 00655 return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() ); 00656 }
const TiXmlElement * OBT::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.
Definition at line 463 of file OBTtinyxml.cpp.
References NextSibling(), and ToElement().
Referenced by OBT::XMLConfigurationFileParser::AddChildren(), OBT::TiXmlHandle::ChildElement(), and OBT::main().
00464 { 00465 const TiXmlNode* node; 00466 00467 for ( node = NextSibling(); 00468 node; 00469 node = node->NextSibling() ) 00470 { 00471 if ( node->ToElement() ) 00472 return node->ToElement(); 00473 } 00474 return 0; 00475 }
bool OBT::TiXmlNode::NoChildren | ( | ) | const [inline] |
Returns true if this node has no children.
Definition at line 703 of file tiny/OBTtinyxml.h.
References firstChild.
00703 { return !firstChild; }
bool OBT::TiXmlNode::NoChildren | ( | ) | const [inline] |
Returns true if this node has no children.
Definition at line 704 of file OBTtinyxml.h.
00704 { return !firstChild; }
void OBT::TiXmlNode::operator= | ( | const TiXmlNode & | base | ) | [private] |
Reimplemented from OBT::TiXmlBase.
Reimplemented in OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, OBT::TiXmlDocument, OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, and OBT::TiXmlDocument.
void OBT::TiXmlNode::operator= | ( | const TiXmlNode & | base | ) | [private] |
Reimplemented from OBT::TiXmlBase.
Reimplemented in OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, OBT::TiXmlDocument, OBT::TiXmlElement, OBT::TiXmlComment, OBT::TiXmlText, OBT::TiXmlDeclaration, OBT::TiXmlUnknown, and OBT::TiXmlDocument.
const TiXmlNode* OBT::TiXmlNode::Parent | ( | ) | const [inline] |
TiXmlNode* OBT::TiXmlNode::Parent | ( | ) | [inline] |
One step up the DOM.
Definition at line 527 of file tiny/OBTtinyxml.h.
References parent.
00527 { return parent; }
const TiXmlNode* OBT::TiXmlNode::Parent | ( | ) | const [inline] |
Definition at line 529 of file OBTtinyxml.h.
00529 { return parent; }
TiXmlNode* OBT::TiXmlNode::Parent | ( | ) | [inline] |
TiXmlNode* OBT::TiXmlNode::PreviousSibling | ( | const char * | _prev | ) | [inline] |
Definition at line 627 of file tiny/OBTtinyxml.h.
const TiXmlNode* OBT::TiXmlNode::PreviousSibling | ( | const char * | ) | const |
Navigate to a sibling node.
TiXmlNode* OBT::TiXmlNode::PreviousSibling | ( | ) | [inline] |
const TiXmlNode* OBT::TiXmlNode::PreviousSibling | ( | ) | const [inline] |
Navigate to a sibling node.
Definition at line 622 of file tiny/OBTtinyxml.h.
References prev.
00622 { return prev; }
TiXmlNode* OBT::TiXmlNode::PreviousSibling | ( | const char * | _prev | ) | [inline] |
Definition at line 628 of file OBTtinyxml.h.
const TiXmlNode * OBT::TiXmlNode::PreviousSibling | ( | const char * | _value | ) | const |
Navigate to a sibling node.
Definition at line 406 of file OBTtinyxml.cpp.
TiXmlNode* OBT::TiXmlNode::PreviousSibling | ( | ) | [inline] |
Definition at line 624 of file OBTtinyxml.h.
00624 { return prev; }
const TiXmlNode* OBT::TiXmlNode::PreviousSibling | ( | ) | const [inline] |
Navigate to a sibling node.
Definition at line 623 of file OBTtinyxml.h.
Referenced by OBT::main().
00623 { return prev; }
bool OBT::TiXmlNode::RemoveChild | ( | TiXmlNode * | removeThis | ) |
Delete a child of this node.
bool OBT::TiXmlNode::RemoveChild | ( | TiXmlNode * | removeThis | ) |
Delete a child of this node.
Definition at line 320 of file OBTtinyxml.cpp.
References firstChild, lastChild, next, parent, and prev.
Referenced by OBT::main().
00321 { 00322 if ( removeThis->parent != this ) 00323 { 00324 assert( 0 ); 00325 return false; 00326 } 00327 00328 if ( removeThis->next ) 00329 removeThis->next->prev = removeThis->prev; 00330 else 00331 lastChild = removeThis->prev; 00332 00333 if ( removeThis->prev ) 00334 removeThis->prev->next = removeThis->next; 00335 else 00336 firstChild = removeThis->next; 00337 00338 delete removeThis; 00339 return true; 00340 }
Replace a child of this node.
Returns a pointer to the new object or NULL if an error occured.
Replace a child of this node.
Returns a pointer to the new object or NULL if an error occured.
Definition at line 292 of file OBTtinyxml.cpp.
References Clone(), firstChild, lastChild, next, parent, and prev.
00293 { 00294 if ( replaceThis->parent != this ) 00295 return 0; 00296 00297 TiXmlNode* node = withThis.Clone(); 00298 if ( !node ) 00299 return 0; 00300 00301 node->next = replaceThis->next; 00302 node->prev = replaceThis->prev; 00303 00304 if ( replaceThis->next ) 00305 replaceThis->next->prev = node; 00306 else 00307 lastChild = node; 00308 00309 if ( replaceThis->prev ) 00310 replaceThis->prev->next = node; 00311 else 00312 firstChild = node; 00313 00314 delete replaceThis; 00315 node->parent = this; 00316 return node; 00317 }
void OBT::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
Definition at line 516 of file tiny/OBTtinyxml.h.
References value.
Referenced by OBT::TiXmlComment::TiXmlComment(), and OBT::TiXmlText::TiXmlText().
00516 { value = _value;}
void OBT::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
Definition at line 517 of file OBTtinyxml.h.
Referenced by CopyTo().
00517 { value = _value;}
virtual TiXmlComment* OBT::TiXmlNode::ToComment | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlComment, and OBT::TiXmlComment.
Definition at line 714 of file tiny/OBTtinyxml.h.
virtual const TiXmlComment* OBT::TiXmlNode::ToComment | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlComment, and OBT::TiXmlComment.
Definition at line 707 of file tiny/OBTtinyxml.h.
virtual TiXmlComment* OBT::TiXmlNode::ToComment | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlComment, and OBT::TiXmlComment.
Definition at line 715 of file OBTtinyxml.h.
virtual const TiXmlComment* OBT::TiXmlNode::ToComment | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlComment, and OBT::TiXmlComment.
Definition at line 708 of file OBTtinyxml.h.
Referenced by OBT::main().
virtual TiXmlDeclaration* OBT::TiXmlNode::ToDeclaration | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlDeclaration, and OBT::TiXmlDeclaration.
Definition at line 717 of file tiny/OBTtinyxml.h.
virtual const TiXmlDeclaration* OBT::TiXmlNode::ToDeclaration | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlDeclaration, and OBT::TiXmlDeclaration.
Definition at line 710 of file tiny/OBTtinyxml.h.
virtual TiXmlDeclaration* OBT::TiXmlNode::ToDeclaration | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlDeclaration, and OBT::TiXmlDeclaration.
Definition at line 718 of file OBTtinyxml.h.
virtual const TiXmlDeclaration* OBT::TiXmlNode::ToDeclaration | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlDeclaration, and OBT::TiXmlDeclaration.
Definition at line 711 of file OBTtinyxml.h.
Referenced by OBT::main(), and OBT::TiXmlDocument::Parse().
virtual TiXmlDocument* OBT::TiXmlNode::ToDocument | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlDocument, and OBT::TiXmlDocument.
Definition at line 712 of file tiny/OBTtinyxml.h.
virtual const TiXmlDocument* OBT::TiXmlNode::ToDocument | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlDocument, and OBT::TiXmlDocument.
Definition at line 705 of file tiny/OBTtinyxml.h.
virtual TiXmlDocument* OBT::TiXmlNode::ToDocument | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlDocument, and OBT::TiXmlDocument.
Definition at line 713 of file OBTtinyxml.h.
virtual const TiXmlDocument* OBT::TiXmlNode::ToDocument | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlDocument, and OBT::TiXmlDocument.
Definition at line 706 of file OBTtinyxml.h.
Referenced by GetDocument().
virtual TiXmlElement* OBT::TiXmlNode::ToElement | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlElement, and OBT::TiXmlElement.
Definition at line 713 of file tiny/OBTtinyxml.h.
virtual const TiXmlElement* OBT::TiXmlNode::ToElement | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlElement, and OBT::TiXmlElement.
Definition at line 706 of file tiny/OBTtinyxml.h.
virtual TiXmlElement* OBT::TiXmlNode::ToElement | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlElement, and OBT::TiXmlElement.
Definition at line 714 of file OBTtinyxml.h.
virtual const TiXmlElement* OBT::TiXmlNode::ToElement | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlElement, and OBT::TiXmlElement.
Definition at line 707 of file OBTtinyxml.h.
Referenced by FirstChildElement(), OBT::main(), and NextSiblingElement().
virtual TiXmlText* OBT::TiXmlNode::ToText | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlText, and OBT::TiXmlText.
Definition at line 716 of file tiny/OBTtinyxml.h.
virtual const TiXmlText* OBT::TiXmlNode::ToText | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlText, and OBT::TiXmlText.
Definition at line 709 of file tiny/OBTtinyxml.h.
virtual TiXmlText* OBT::TiXmlNode::ToText | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlText, and OBT::TiXmlText.
Definition at line 717 of file OBTtinyxml.h.
virtual const TiXmlText* OBT::TiXmlNode::ToText | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlText, and OBT::TiXmlText.
Definition at line 710 of file OBTtinyxml.h.
Referenced by OBT::TiXmlElement::GetText(), OBT::main(), OBT::TiXmlElement::Print(), and OBT::TiXmlPrinter::VisitEnter().
virtual TiXmlUnknown* OBT::TiXmlNode::ToUnknown | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlUnknown, and OBT::TiXmlUnknown.
Definition at line 715 of file tiny/OBTtinyxml.h.
virtual const TiXmlUnknown* OBT::TiXmlNode::ToUnknown | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlUnknown, and OBT::TiXmlUnknown.
Definition at line 708 of file tiny/OBTtinyxml.h.
virtual TiXmlUnknown* OBT::TiXmlNode::ToUnknown | ( | ) | [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlUnknown, and OBT::TiXmlUnknown.
Definition at line 716 of file OBTtinyxml.h.
virtual const TiXmlUnknown* OBT::TiXmlNode::ToUnknown | ( | ) | const [inline, virtual] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in OBT::TiXmlUnknown, and OBT::TiXmlUnknown.
Definition at line 709 of file OBTtinyxml.h.
int OBT::TiXmlNode::Type | ( | ) | const [inline] |
Query the type (as an enumerated value, above) of this node.
The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION.
Definition at line 692 of file tiny/OBTtinyxml.h.
References type.
00692 { return type; }
int OBT::TiXmlNode::Type | ( | ) | const [inline] |
Query the type (as an enumerated value, above) of this node.
The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION.
Definition at line 693 of file OBTtinyxml.h.
Referenced by InsertAfterChild(), InsertBeforeChild(), InsertEndChild(), and LinkEndChild().
00693 { return type; }
const char* OBT::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.
Definition at line 495 of file tiny/OBTtinyxml.h.
References value.
00495 { return value.c_str (); }
const char* OBT::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.
Definition at line 496 of file OBTtinyxml.h.
Referenced by OBT::XMLConfigurationFileParser::AddChildren(), OBT::TiXmlElement::Clone(), FirstChild(), OBT::TiXmlElement::GetText(), LastChild(), OBT::TiXmlDocument::LoadFile(), OBT::main(), NextSibling(), PreviousSibling(), OBT::TiXmlDocument::SaveFile(), OBT::TiXmlPrinter::Visit(), OBT::TiXmlPrinter::VisitEnter(), and OBT::TiXmlPrinter::VisitExit().
00496 { return value.c_str (); }
const TIXML_STRING& OBT::TiXmlNode::ValueTStr | ( | ) | const [inline] |
const TIXML_STRING& OBT::TiXmlNode::ValueTStr | ( | ) | const [inline] |
Definition at line 506 of file OBTtinyxml.h.
Referenced by OBT::TiXmlPrinter::Visit().
00506 { return value; }
TiXmlDocument [friend] |
Reimplemented from OBT::TiXmlBase.
Definition at line 434 of file OBTtinyxml.h.
TiXmlElement [friend] |
Reimplemented from OBT::TiXmlBase.
Reimplemented in OBT::TiXmlText.
Definition at line 435 of file OBTtinyxml.h.
Referenced by Identify().
TiXmlNode * OBT::TiXmlNode::firstChild [protected] |
Definition at line 767 of file OBTtinyxml.h.
Referenced by Clear(), OBT::TiXmlDocument::CopyTo(), OBT::TiXmlElement::CopyTo(), FirstChild(), InsertBeforeChild(), LinkEndChild(), NoChildren(), OBT::TiXmlDocument::Parse(), OBT::TiXmlElement::Print(), RemoveChild(), ReplaceChild(), OBT::TiXmlElement::TiXmlElement(), TiXmlNode(), and ~TiXmlNode().
TiXmlNode * OBT::TiXmlNode::lastChild [protected] |
Definition at line 768 of file OBTtinyxml.h.
Referenced by Clear(), InsertAfterChild(), LastChild(), LinkEndChild(), OBT::TiXmlElement::Print(), RemoveChild(), ReplaceChild(), OBT::TiXmlElement::TiXmlElement(), and TiXmlNode().
TiXmlNode * OBT::TiXmlNode::next [protected] |
Definition at line 773 of file OBTtinyxml.h.
Referenced by Clear(), FirstChild(), InsertAfterChild(), InsertBeforeChild(), LinkEndChild(), NextSibling(), RemoveChild(), ReplaceChild(), TiXmlNode(), and ~TiXmlNode().
TiXmlNode * OBT::TiXmlNode::parent [protected] |
Definition at line 764 of file OBTtinyxml.h.
Referenced by GetDocument(), Identify(), InsertAfterChild(), InsertBeforeChild(), IterateChildren(), LinkEndChild(), Parent(), RemoveChild(), ReplaceChild(), and TiXmlNode().
TiXmlNode * OBT::TiXmlNode::prev [protected] |
Definition at line 772 of file OBTtinyxml.h.
Referenced by InsertAfterChild(), InsertBeforeChild(), LastChild(), LinkEndChild(), PreviousSibling(), RemoveChild(), ReplaceChild(), and TiXmlNode().
NodeType OBT::TiXmlNode::type [protected] |
Definition at line 765 of file OBTtinyxml.h.
Referenced by TiXmlNode(), and Type().
TIXML_STRING OBT::TiXmlNode::value [protected] |
Definition at line 770 of file OBTtinyxml.h.
Referenced by OBT::TiXmlText::Blank(), CopyTo(), OBT::TiXmlDocument::LoadFile(), OBT::TiXmlText::Parse(), OBT::TiXmlComment::Parse(), OBT::TiXmlUnknown::Parse(), OBT::TiXmlElement::Parse(), OBT::TiXmlUnknown::Print(), OBT::TiXmlText::Print(), OBT::TiXmlComment::Print(), OBT::TiXmlElement::Print(), SetValue(), OBT::TiXmlDocument::TiXmlDocument(), OBT::TiXmlElement::TiXmlElement(), Value(), and ValueTStr().