Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
TiXmlElement Class Reference
The element is a container class. More...
#include <tinyxml.h>
Inherits TiXmlNode.
Public Types | |
| enum | NodeType |
The types of XML nodes supported by TinyXml. More... | |
Public Member Functions | |
| TiXmlElement (const char *in_value) | |
| Construct an element. | |
| TiXmlElement (const std::string &_value) | |
| std::string constructor. | |
| const char * | Attribute (const char *name) const |
| Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. | |
| const char * | Attribute (const char *name, int *i) const |
| Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. | |
| const char * | Attribute (const char *name, double *d) const |
| Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. | |
| int | QueryIntAttribute (const char *name, int *_value) const |
| QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking. | |
| int | QueryDoubleAttribute (const char *name, double *_value) const |
| QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). | |
| int | QueryFloatAttribute (const char *name, float *_value) const |
| QueryFloatAttribute examines the attribute - see QueryIntAttribute(). | |
| int | QueryStringAttribute (const char *name, std::string *_value) const |
| QueryStringAttribute examines the attribute - see QueryIntAttribute(). | |
| template<typename T > | |
| int | QueryValueAttribute (const std::string &name, T *outValue) const |
| Template form of the attribute query which will try to read the attribute into the specified type. | |
| void | SetAttribute (const char *name, const char *_value) |
| Sets an attribute of name to a given value. | |
| void | SetAttribute (const std::string &name, const std::string &_value) |
| void | SetAttribute (const std::string &name, int _value) |
| STL std::string form. | |
| void | SetAttribute (const char *name, int value) |
| Sets an attribute of name to a given value. | |
| void | SetDoubleAttribute (const char *name, double value) |
| Sets an attribute of name to a given value. | |
| void | RemoveAttribute (const char *name) |
| Deletes an attribute with the given name. | |
| void | RemoveAttribute (const std::string &name) |
| STL std::string form. | |
| const TiXmlAttribute * | FirstAttribute () const |
| Access the first attribute in this element. | |
| const TiXmlAttribute * | LastAttribute () const |
| Access the last attribute in this element. | |
| const char * | GetText () const |
| Convenience function for easy access to the text inside an element. | |
| virtual TiXmlNode * | Clone () const |
| Creates a new Element and returns it - the returned element is a copy. | |
| virtual void | Print (FILE *cfile, int depth) const |
| All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.) Either or both cfile and str can be null. | |
| virtual const TiXmlElement * | ToElement () const |
| Cast to a more defined type. Will return null not of the requested type. | |
| virtual TiXmlElement * | ToElement () |
| Cast to a more defined type. Will return null not of the requested type. | |
| virtual bool | Accept (TiXmlVisitor *visitor) const |
| Walk the XML tree visiting this node and all of its children. | |
| const char * | Value () const |
| The meaning of 'value' changes for the specific type of TiXmlNode. | |
| const std::string & | ValueStr () const |
| Return Value() as a std::string. | |
| void | SetValue (const char *_value) |
| Changes the value of the node. | |
| void | SetValue (const std::string &_value) |
| STL std::string form. | |
| void | Clear () |
| Delete all the children of this node. Does not affect 'this'. | |
| TiXmlNode * | Parent () |
| One step up the DOM. | |
| const TiXmlNode * | FirstChild () const |
| The first child of this node. Will be null if there are no children. | |
| 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 * | FirstChild (const std::string &_value) const |
| STL std::string form. | |
| TiXmlNode * | FirstChild (const std::string &_value) |
| STL std::string form. | |
| TiXmlNode * | LastChild () |
| The last child of this node. Will be null if there are no children. | |
| TiXmlNode * | LastChild (const char *_value) |
| The last child of this node matching 'value'. Will be null if there are no children. | |
| const TiXmlNode * | LastChild (const std::string &_value) const |
| STL std::string form. | |
| TiXmlNode * | LastChild (const std::string &_value) |
| STL std::string form. | |
| const TiXmlNode * | IterateChildren (const TiXmlNode *previous) const |
| An alternate way to walk the children of a node. | |
| const TiXmlNode * | IterateChildren (const char *value, const TiXmlNode *previous) const |
| This flavor of IterateChildren searches for children with a particular 'value'. | |
| const TiXmlNode * | IterateChildren (const std::string &_value, const TiXmlNode *previous) const |
| STL std::string form. | |
| TiXmlNode * | IterateChildren (const std::string &_value, const TiXmlNode *previous) |
| STL std::string form. | |
| 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. | |
| const TiXmlNode * | PreviousSibling (const char *) const |
| Navigate to a sibling node. | |
| const TiXmlNode * | PreviousSibling (const std::string &_value) const |
| STL std::string form. | |
| TiXmlNode * | PreviousSibling (const std::string &_value) |
| STL std::string form. | |
| const TiXmlNode * | NextSibling (const std::string &_value) const |
| STL std::string form. | |
| TiXmlNode * | NextSibling (const std::string &_value) |
| STL std::string form. | |
| const TiXmlNode * | NextSibling () const |
| Navigate to a sibling node. | |
| const TiXmlNode * | NextSibling (const char *) const |
| Navigate to a sibling node with the given 'value'. | |
| const TiXmlElement * | NextSiblingElement () const |
| Convenience function to get through elements. | |
| const TiXmlElement * | NextSiblingElement (const char *) const |
| Convenience function to get through elements. | |
| const TiXmlElement * | NextSiblingElement (const std::string &_value) const |
| STL std::string form. | |
| TiXmlElement * | NextSiblingElement (const std::string &_value) |
| STL std::string form. | |
| const TiXmlElement * | FirstChildElement () const |
| Convenience function to get through elements. | |
| const TiXmlElement * | FirstChildElement (const char *_value) const |
| Convenience function to get through elements. | |
| const TiXmlElement * | FirstChildElement (const std::string &_value) const |
| STL std::string form. | |
| TiXmlElement * | FirstChildElement (const std::string &_value) |
| STL std::string form. | |
| 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. | |
| 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 TiXmlDocument * | ToDocument () |
| 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 TiXmlComment * | ToComment () |
| 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 TiXmlUnknown * | ToUnknown () |
| 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 TiXmlText * | ToText () |
| 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 TiXmlDeclaration * | ToDeclaration () |
| Cast to a more defined type. Will return null if not of the requested type. | |
| int | Row () const |
| Return the position, in the original source file, of this node or attribute. | |
| int | Column () const |
| See Row() | |
| void | SetUserData (void *user) |
| Set a pointer to arbitrary user data. | |
| void * | GetUserData () |
| Get a pointer to arbitrary user data. | |
| const void * | GetUserData () const |
| Get a pointer to arbitrary user data. | |
Static Public Member Functions | |
| static void | SetCondenseWhiteSpace (bool condense) |
| The world does not agree on whether white space should be kept or not. | |
| static bool | IsWhiteSpaceCondensed () |
| Return the current white space setting. | |
| static void | EncodeString (const TIXML_STRING &str, TIXML_STRING *out) |
| Expands entities in a string. | |
Protected Attributes | |
| void * | userData |
| Field containing a generic user pointer. | |
Friends | |
| std::istream & | operator>> (std::istream &in, TiXmlNode &base) |
| An input stream operator, for every class. | |
| std::ostream & | operator<< (std::ostream &out, const TiXmlNode &base) |
| An output stream operator, for every class. | |
| std::string & | operator<< (std::string &out, const TiXmlNode &base) |
| Appends the XML node or attribute to a std::string. | |
Detailed Description
The element is a container class.
It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes.
Definition at line 942 of file tinyxml.h.
Member Enumeration Documentation
enum NodeType [inherited] |
Constructor & Destructor Documentation
| TiXmlElement | ( | const char * | in_value ) |
Construct an element.
Definition at line 520 of file tinyxml.cpp.
| TiXmlElement | ( | const std::string & | _value ) |
std::string constructor.
Definition at line 529 of file tinyxml.cpp.
Member Function Documentation
| bool Accept | ( | TiXmlVisitor * | visitor ) | const [virtual] |
Walk the XML tree visiting this node and all of its children.
Implements TiXmlNode.
Definition at line 830 of file tinyxml.cpp.
| const char * Attribute | ( | const char * | name ) | const |
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
Definition at line 571 of file tinyxml.cpp.
| const char * Attribute | ( | const char * | name, |
| double * | d | ||
| ) | const |
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
If the attribute exists and can be converted to an double, the double value will be put in the return 'd', if 'd' is non-null.
Definition at line 623 of file tinyxml.cpp.
| const char * Attribute | ( | const char * | name, |
| int * | i | ||
| ) | const |
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
If the attribute exists and can be converted to an integer, the integer value will be put in the return 'i', if 'i' is non-null.
Definition at line 591 of file tinyxml.cpp.
| void Clear | ( | ) | [inherited] |
Delete all the children of this node. Does not affect 'this'.
Definition at line 168 of file tinyxml.cpp.
| TiXmlNode * Clone | ( | ) | const [virtual] |
Creates a new Element and returns it - the returned element is a copy.
Implements TiXmlNode.
Definition at line 844 of file tinyxml.cpp.
| void EncodeString | ( | const TIXML_STRING & | str, |
| TIXML_STRING * | out | ||
| ) | [static, inherited] |
Expands entities in a string.
Note this should not contian the tag's '<', '>', etc, or they will be transformed into entities!
Definition at line 51 of file tinyxml.cpp.
| const TiXmlAttribute* FirstAttribute | ( | ) | const |
| const TiXmlNode* FirstChild | ( | ) | const [inherited] |
| const TiXmlNode * FirstChild | ( | const char * | value ) | const [inherited] |
The first child of this node with the matching 'value'.
Will be null if none found.
Definition at line 356 of file tinyxml.cpp.
| TiXmlNode* FirstChild | ( | const char * | _value ) | [inherited] |
| const TiXmlNode* FirstChild | ( | const std::string & | _value ) | const [inherited] |
| TiXmlNode* FirstChild | ( | const std::string & | _value ) | [inherited] |
| const TiXmlElement * FirstChildElement | ( | ) | const [inherited] |
Convenience function to get through elements.
Definition at line 447 of file tinyxml.cpp.
| const TiXmlElement * FirstChildElement | ( | const char * | _value ) | const [inherited] |
Convenience function to get through elements.
Definition at line 462 of file tinyxml.cpp.
| const TiXmlElement* FirstChildElement | ( | const std::string & | _value ) | const [inherited] |
| TiXmlElement* FirstChildElement | ( | const std::string & | _value ) | [inherited] |
| const TiXmlDocument * GetDocument | ( | ) | const [inherited] |
Return a pointer to the Document this node lives in.
Returns null if not in a document.
Definition at line 507 of file tinyxml.cpp.
| const char * GetText | ( | ) | const |
Convenience function for easy access to the text inside an element.
Although easy and concise, GetText() is limited compared to getting the TiXmlText child and accessing it directly.
If the first child of 'this' is a TiXmlText, the GetText() returns the character string of the Text node, else null is returned.
This is a convenient method for getting the text of simple contained text:
<foo>This is text</foo>
const char* str = fooElement->GetText();
'str' will be a pointer to "This is text".
Note that this function can be misleading. If the element foo was created from this XML:
<foo><b>This is text</b></foo>
then the value of str would be null. The first child node isn't a text node, it is another element. From this XML:
<foo>This is <b>text</b></foo>
GetText() will return "This is ".
WARNING: GetText() accesses a child node - don't become confused with the similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are safe type casts on the referenced node.
Definition at line 855 of file tinyxml.cpp.
| void* GetUserData | ( | ) | [inherited] |
| const void* GetUserData | ( | ) | const [inherited] |
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 259 of file tinyxml.cpp.
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 227 of file tinyxml.cpp.
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 212 of file tinyxml.cpp.
| static bool IsWhiteSpaceCondensed | ( | ) | [static, inherited] |
| const TiXmlNode * IterateChildren | ( | const char * | value, |
| const TiXmlNode * | previous | ||
| ) | const [inherited] |
This flavor of IterateChildren searches for children with a particular 'value'.
Definition at line 394 of file tinyxml.cpp.
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 380 of file tinyxml.cpp.
| const TiXmlAttribute* LastAttribute | ( | ) | const |
| TiXmlNode* LastChild | ( | const std::string & | _value ) | [inherited] |
| TiXmlNode* LastChild | ( | ) | [inherited] |
| TiXmlNode* LastChild | ( | const char * | _value ) | [inherited] |
| const TiXmlNode* LastChild | ( | const std::string & | _value ) | const [inherited] |
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.
- See also:
- InsertEndChild
Definition at line 185 of file tinyxml.cpp.
| const TiXmlNode* NextSibling | ( | const std::string & | _value ) | const [inherited] |
| TiXmlNode* NextSibling | ( | const std::string & | _value ) | [inherited] |
| const TiXmlNode* NextSibling | ( | ) | const [inherited] |
| const TiXmlNode * NextSibling | ( | const char * | _value ) | const [inherited] |
Navigate to a sibling node with the given 'value'.
Definition at line 408 of file tinyxml.cpp.
| const TiXmlElement * NextSiblingElement | ( | ) | const [inherited] |
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 477 of file tinyxml.cpp.
| const TiXmlElement * NextSiblingElement | ( | const char * | _value ) | const [inherited] |
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 492 of file tinyxml.cpp.
| const TiXmlElement* NextSiblingElement | ( | const std::string & | _value ) | const [inherited] |
| TiXmlElement* NextSiblingElement | ( | const std::string & | _value ) | [inherited] |
| bool NoChildren | ( | ) | const [inherited] |
| const TiXmlNode* PreviousSibling | ( | ) | const [inherited] |
| const TiXmlNode * PreviousSibling | ( | const char * | _value ) | const [inherited] |
Navigate to a sibling node.
Definition at line 420 of file tinyxml.cpp.
| TiXmlNode* PreviousSibling | ( | const std::string & | _value ) | [inherited] |
| const TiXmlNode* PreviousSibling | ( | const std::string & | _value ) | const [inherited] |
| void Print | ( | FILE * | cfile, |
| int | depth | ||
| ) | const [virtual] |
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.) Either or both cfile and str can be null.
This is a formatted print, and will insert tabs and newlines.
(For an unformatted stream, use the << operator.)
Implements TiXmlBase.
Definition at line 755 of file tinyxml.cpp.
| int QueryDoubleAttribute | ( | const char * | name, |
| double * | _value | ||
| ) | const |
QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
Definition at line 675 of file tinyxml.cpp.
| int QueryFloatAttribute | ( | const char * | name, |
| float * | _value | ||
| ) | const |
QueryFloatAttribute examines the attribute - see QueryIntAttribute().
| int QueryIntAttribute | ( | const char * | name, |
| int * | _value | ||
| ) | const |
QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking.
If the attribute is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. If the attribute does not exist, then TIXML_NO_ATTRIBUTE is returned.
Definition at line 655 of file tinyxml.cpp.
| int QueryStringAttribute | ( | const char * | name, |
| std::string * | _value | ||
| ) | const |
QueryStringAttribute examines the attribute - see QueryIntAttribute().
| int QueryValueAttribute | ( | const std::string & | name, |
| T * | outValue | ||
| ) | const |
Template form of the attribute query which will try to read the attribute into the specified type.
Very easy, very powerful, but be careful to make sure to call this with the correct type.
NOTE: This method doesn't work correctly for 'string' types that contain spaces.
- Returns:
- TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE
| void RemoveAttribute | ( | const std::string & | name ) |
| void RemoveAttribute | ( | const char * | name ) |
Deletes an attribute with the given name.
Definition at line 432 of file tinyxml.cpp.
| bool RemoveChild | ( | TiXmlNode * | removeThis ) | [inherited] |
Delete a child of this node.
Definition at line 330 of file tinyxml.cpp.
Replace a child of this node.
Returns a pointer to the new object or NULL if an error occured.
Definition at line 291 of file tinyxml.cpp.
| int Row | ( | ) | const [inherited] |
Return the position, in the original source file, of this node or attribute.
The row and column are 1-based. (That is the first row and first column is 1,1). If the returns values are 0 or less, then the parser does not have a row and column value.
Generally, the row and column value will be set when the TiXmlDocument::Load(), TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set when the DOM was created from operator>>.
The values reflect the initial load. Once the DOM is modified programmatically (by adding or changing nodes and attributes) the new values will NOT update to reflect changes in the document.
There is a minor performance cost to computing the row and column. Computation can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value.
- See also:
- TiXmlDocument::SetTabSize()
| void SetAttribute | ( | const std::string & | name, |
| int | _value | ||
| ) |
STL std::string form.
Definition at line 705 of file tinyxml.cpp.
| void SetAttribute | ( | const std::string & | name, |
| const std::string & | _value | ||
| ) |
STL std::string form.
Definition at line 745 of file tinyxml.cpp.
| void SetAttribute | ( | const char * | name, |
| int | value | ||
| ) |
Sets an attribute of name to a given value.
The attribute will be created if it does not exist, or changed if it does.
Definition at line 695 of file tinyxml.cpp.
| void SetAttribute | ( | const char * | name, |
| const char * | _value | ||
| ) |
Sets an attribute of name to a given value.
The attribute will be created if it does not exist, or changed if it does.
Definition at line 735 of file tinyxml.cpp.
| static void SetCondenseWhiteSpace | ( | bool | condense ) | [static, inherited] |
The world does not agree on whether white space should be kept or not.
In order to make everyone happy, these global, static functions are provided to set whether or not TinyXml will condense all white space into a single space or not. The default is to condense. Note changing this value is not thread safe.
| void SetDoubleAttribute | ( | const char * | name, |
| double | value | ||
| ) |
Sets an attribute of name to a given value.
The attribute will be created if it does not exist, or changed if it does.
Definition at line 715 of file tinyxml.cpp.
| void SetUserData | ( | void * | user ) | [inherited] |
| void SetValue | ( | const std::string & | _value ) | [inherited] |
| void SetValue | ( | const char * | _value ) | [inherited] |
| virtual const TiXmlComment* ToComment | ( | ) | const [virtual, inherited] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in TiXmlComment.
| virtual TiXmlComment* ToComment | ( | ) | [virtual, inherited] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in TiXmlComment.
| virtual TiXmlDeclaration* ToDeclaration | ( | ) | [virtual, inherited] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in TiXmlDeclaration.
| virtual const TiXmlDeclaration* ToDeclaration | ( | ) | const [virtual, inherited] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in TiXmlDeclaration.
| virtual TiXmlDocument* ToDocument | ( | ) | [virtual, inherited] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in TiXmlDocument.
| virtual const TiXmlDocument* ToDocument | ( | ) | const [virtual, inherited] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in TiXmlDocument.
| virtual const TiXmlElement* ToElement | ( | ) | const [virtual] |
| virtual TiXmlElement* ToElement | ( | ) | [virtual] |
| virtual const TiXmlText* ToText | ( | ) | const [virtual, inherited] |
| virtual TiXmlText* ToText | ( | ) | [virtual, inherited] |
| virtual TiXmlUnknown* ToUnknown | ( | ) | [virtual, inherited] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in TiXmlUnknown.
| virtual const TiXmlUnknown* ToUnknown | ( | ) | const [virtual, inherited] |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in TiXmlUnknown.
| int Type | ( | ) | const [inherited] |
| const char* Value | ( | ) | const [inherited] |
| const std::string& ValueStr | ( | ) | const [inherited] |
Friends And Related Function Documentation
| std::ostream& operator<< | ( | std::ostream & | out, |
| const TiXmlNode & | base | ||
| ) | [friend, inherited] |
An output stream operator, for every class.
Note that this outputs without any newlines or formatting, as opposed to Print(), which includes tabs and new lines.
The operator<< and operator>> are not completely symmetric. Writing a node to a stream is very well defined. You'll get a nice stream of output, without any extra whitespace or newlines.
But reading is not as well defined. (As it always is.) If you create a TiXmlElement (for example) and read that from an input stream, the text needs to define an element or junk will result. This is true of all input streams, but it's worth keeping in mind.
A TiXmlDocument will read nodes until it reads a root element, and all the children of that root element.
Definition at line 1561 of file tinyxml.cpp.
| std::string& operator<< | ( | std::string & | out, |
| const TiXmlNode & | base | ||
| ) | [friend, inherited] |
Appends the XML node or attribute to a std::string.
Definition at line 1572 of file tinyxml.cpp.
| std::istream& operator>> | ( | std::istream & | in, |
| TiXmlNode & | base | ||
| ) | [friend, inherited] |
An input stream operator, for every class.
Tolerant of newlines and formatting, but doesn't expect them.
Definition at line 1548 of file tinyxml.cpp.
Field Documentation
Generated on Tue Jul 12 2022 20:43:31 by
1.7.2