Orocos Real-Time Toolkit
2.8.3
|
Always the top level node. More...
#include <rtt/marsh/tinyxml.h>
Public Types | |
enum | NodeType { DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, DECLARATION, TYPECOUNT } |
The types of XML nodes supported by TinyXml. More... | |
enum | { TIXML_NO_ERROR = 0, TIXML_ERROR, TIXML_ERROR_OPENING_FILE, TIXML_ERROR_OUT_OF_MEMORY, TIXML_ERROR_PARSING_ELEMENT, TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, TIXML_ERROR_READING_ELEMENT_VALUE, TIXML_ERROR_READING_ATTRIBUTES, TIXML_ERROR_PARSING_EMPTY, TIXML_ERROR_READING_END_TAG, TIXML_ERROR_PARSING_UNKNOWN, TIXML_ERROR_PARSING_COMMENT, TIXML_ERROR_PARSING_DECLARATION, TIXML_ERROR_DOCUMENT_EMPTY, TIXML_ERROR_EMBEDDED_NULL, TIXML_ERROR_PARSING_CDATA, TIXML_ERROR_STRING_COUNT } |
Public Member Functions | |
TiXmlDocument () | |
Create an empty document, that has no name. More... | |
TiXmlDocument (const char *documentName) | |
Create a document with a name. The name of the document is also the filename of the xml. More... | |
TiXmlDocument (const TiXmlDocument ©) | |
void | operator= (const TiXmlDocument ©) |
virtual | ~TiXmlDocument () |
bool | LoadFile (TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) |
Load a file using the current document value. More... | |
bool | SaveFile () const |
Save a file using the current document value. Returns true if successful. More... | |
bool | LoadFile (const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) |
Load a file using the given filename. Returns true if successful. More... | |
bool | SaveFile (const char *filename) const |
Save a file using the given filename. Returns true if successful. More... | |
bool | LoadFile (FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) |
Load a file using the given FILE*. More... | |
bool | SaveFile (FILE *) const |
Save a file using the given FILE*. Returns true if successful. More... | |
virtual const char * | Parse (const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) |
Parse the given null terminated block of xml data. More... | |
const TiXmlElement * | RootElement () const |
Get the root element – the only top level element – of the document. More... | |
TiXmlElement * | RootElement () |
bool | Error () const |
If an error occurs, Error will be set to true. More... | |
const char * | ErrorDesc () const |
Contains a textual (english) description of the error if one occurs. More... | |
int | ErrorId () const |
Generally, you probably want the error string ( ErrorDesc() ). More... | |
int | ErrorRow () |
Returns the location (if known) of the error. More... | |
int | ErrorCol () |
The column where the error occured. See ErrorRow() More... | |
void | SetTabSize (int _tabsize) |
SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to report the correct values for row and column. More... | |
int | TabSize () const |
void | ClearError () |
If you have handled the error, it can be reset with this call. More... | |
void | Print () const |
Dump the document to standard out. More... | |
virtual void | Print (FILE *cfile, int depth=0) const |
Print this Document to a FILE stream. More... | |
void | SetError (int err, const char *errorLocation, TiXmlParsingData *prevData, TiXmlEncoding encoding) |
virtual const TiXmlDocument * | ToDocument () const |
Cast to a more defined type. Will return null not of the requested type. More... | |
virtual TiXmlDocument * | ToDocument () |
Cast to a more defined type. Will return null not of the requested type. More... | |
const char * | Value () const |
The meaning of 'value' changes for the specific type of TiXmlNode. More... | |
void | SetValue (const char *_value) |
Changes the value of the node. More... | |
void | Clear () |
Delete all the children of this node. Does not affect 'this'. More... | |
TiXmlNode * | Parent () |
One step up the DOM. More... | |
const TiXmlNode * | Parent () const |
const TiXmlNode * | FirstChild () const |
The first child of this node. Will be null if there are no children. More... | |
TiXmlNode * | FirstChild () |
const TiXmlNode * | FirstChild (const char *value) const |
The first child of this node with the matching 'value'. Will be null if none found. More... | |
TiXmlNode * | FirstChild (const char *value) |
The first child of this node with the matching 'value'. Will be null if none found. More... | |
const TiXmlNode * | LastChild () const |
TiXmlNode * | LastChild () |
The last child of this node. Will be null if there are no children. More... | |
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. More... | |
const TiXmlNode * | IterateChildren (const TiXmlNode *previous) const |
An alternate way to walk the children of a node. More... | |
TiXmlNode * | IterateChildren (TiXmlNode *previous) |
const TiXmlNode * | IterateChildren (const char *value, const TiXmlNode *previous) const |
This flavor of IterateChildren searches for children with a particular 'value'. More... | |
TiXmlNode * | IterateChildren (const char *value, TiXmlNode *previous) |
TiXmlNode * | InsertEndChild (const TiXmlNode &addThis) |
Add a new node related to this. More... | |
TiXmlNode * | LinkEndChild (TiXmlNode *addThis) |
Add a new node related to this. More... | |
TiXmlNode * | InsertBeforeChild (TiXmlNode *beforeThis, const TiXmlNode &addThis) |
Add a new node related to this. More... | |
TiXmlNode * | InsertAfterChild (TiXmlNode *afterThis, const TiXmlNode &addThis) |
Add a new node related to this. More... | |
TiXmlNode * | ReplaceChild (TiXmlNode *replaceThis, const TiXmlNode &withThis) |
Replace a child of this node. More... | |
bool | RemoveChild (TiXmlNode *removeThis) |
Delete a child of this node. More... | |
const TiXmlNode * | PreviousSibling () const |
Navigate to a sibling node. More... | |
TiXmlNode * | PreviousSibling () |
const TiXmlNode * | PreviousSibling (const char *) const |
Navigate to a sibling node. More... | |
TiXmlNode * | PreviousSibling (const char *) |
const TiXmlNode * | NextSibling () const |
Navigate to a sibling node. More... | |
TiXmlNode * | NextSibling () |
const TiXmlNode * | NextSibling (const char *) const |
Navigate to a sibling node with the given 'value'. More... | |
TiXmlNode * | NextSibling (const char *) |
const TiXmlElement * | NextSiblingElement () const |
Convenience function to get through elements. More... | |
TiXmlElement * | NextSiblingElement () |
const TiXmlElement * | NextSiblingElement (const char *) const |
Convenience function to get through elements. More... | |
TiXmlElement * | NextSiblingElement (const char *) |
const TiXmlElement * | FirstChildElement () const |
Convenience function to get through elements. More... | |
TiXmlElement * | FirstChildElement () |
const TiXmlElement * | FirstChildElement (const char *value) const |
Convenience function to get through elements. More... | |
TiXmlElement * | FirstChildElement (const char *value) |
int | Type () const |
Query the type (as an enumerated value, above) of this node. More... | |
const TiXmlDocument * | GetDocument () const |
Return a pointer to the Document this node lives in. More... | |
TiXmlDocument * | GetDocument () |
bool | NoChildren () const |
Returns true if this node has no children. More... | |
virtual const TiXmlElement * | ToElement () const |
Cast to a more defined type. Will return null if not of the requested type. More... | |
virtual TiXmlElement * | ToElement () |
Cast to a more defined type. Will return null if not of the requested type. More... | |
virtual const TiXmlComment * | ToComment () const |
Cast to a more defined type. Will return null if not of the requested type. More... | |
virtual TiXmlComment * | ToComment () |
Cast to a more defined type. Will return null if not of the requested type. More... | |
virtual const TiXmlUnknown * | ToUnknown () const |
Cast to a more defined type. Will return null if not of the requested type. More... | |
virtual TiXmlUnknown * | ToUnknown () |
Cast to a more defined type. Will return null if not of the requested type. More... | |
virtual const TiXmlText * | ToText () const |
Cast to a more defined type. Will return null if not of the requested type. More... | |
virtual TiXmlText * | ToText () |
Cast to a more defined type. Will return null if not of the requested type. More... | |
virtual const TiXmlDeclaration * | ToDeclaration () const |
Cast to a more defined type. Will return null if not of the requested type. More... | |
virtual TiXmlDeclaration * | ToDeclaration () |
Cast to a more defined type. Will return null if not of the requested type. More... | |
int | Row () const |
Return the position, in the original source file, of this node or attribute. More... | |
int | Column () const |
See Row() More... | |
void | SetUserData (void *user) |
void * | GetUserData () |
Static Public Member Functions | |
static void | SetCondenseWhiteSpace (bool condense) |
The world does not agree on whether white space should be kept or not. More... | |
static bool | IsWhiteSpaceCondensed () |
Return the current white space setting. More... | |
Static Public Attributes | |
static const int | utf8ByteTable [256] |
Protected Member Functions | |
virtual void | StreamOut (TIXML_OSTREAM *out) const |
virtual TiXmlNode * | Clone () const |
Create an exact duplicate of this node and return it. More... | |
void | CopyTo (TiXmlNode *target) const |
TiXmlNode * | Identify (const char *start, TiXmlEncoding encoding) |
Static Protected Member Functions | |
static const char * | SkipWhiteSpace (const char *, TiXmlEncoding encoding) |
static bool | IsWhiteSpace (char c) |
static bool | IsWhiteSpace (int c) |
static const char * | ReadName (const char *p, TIXML_STRING *name, TiXmlEncoding encoding) |
static const char * | ReadText (const char *in, TIXML_STRING *text, bool ignoreWhiteSpace, const char *endTag, bool ignoreCase, TiXmlEncoding encoding) |
static const char * | GetEntity (const char *in, char *value, int *length, TiXmlEncoding encoding) |
static const char * | GetChar (const char *p, char *_value, int *length, TiXmlEncoding encoding) |
static void | PutString (const TIXML_STRING &str, TIXML_OSTREAM *out) |
static void | PutString (const TIXML_STRING &str, TIXML_STRING *out) |
static bool | StringEqual (const char *p, const char *endTag, bool ignoreCase, TiXmlEncoding encoding) |
static int | IsAlpha (unsigned char anyByte, TiXmlEncoding encoding) |
static int | IsAlphaNum (unsigned char anyByte, TiXmlEncoding encoding) |
static int | ToLower (int v, TiXmlEncoding encoding) |
static void | ConvertUTF32ToUTF8 (unsigned long input, char *output, int *length) |
Protected Attributes | |
TiXmlNode * | parent |
NodeType | type |
TiXmlNode * | firstChild |
TiXmlNode * | lastChild |
TIXML_STRING | value |
TiXmlNode * | prev |
TiXmlNode * | next |
TiXmlCursor | location |
void * | userData |
Field containing a generic user pointer. More... | |
Static Protected Attributes | |
static const char * | errorString [TIXML_ERROR_STRING_COUNT] |
Always the top level node.
A document binds together all the XML pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name.
|
inherited |
|
inherited |
RTT::marsh::TiXmlDocument::TiXmlDocument | ( | ) |
Create an empty document, that has no name.
Definition at line 980 of file tinyxml.cpp.
References ClearError().
Referenced by Clone(), and TiXmlDocument().
RTT::marsh::TiXmlDocument::TiXmlDocument | ( | const char * | documentName | ) |
Create a document with a name. The name of the document is also the filename of the xml.
Definition at line 987 of file tinyxml.cpp.
References ClearError(), RTT::marsh::TiXmlNode::DOCUMENT, TiXmlDocument(), RTT::marsh::TiXmlNode::TiXmlNode(), and RTT::marsh::TiXmlNode::value.
RTT::marsh::TiXmlDocument::TiXmlDocument | ( | const TiXmlDocument & | copy | ) |
Definition at line 1007 of file tinyxml.cpp.
|
inlinevirtual |
Definition at line 1275 of file tinyxml.h.
References RTT::marsh::TiXmlBase::StringToBuffer::buffer.
|
inherited |
Delete all the children of this node. Does not affect 'this'.
Definition at line 216 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::firstChild, RTT::marsh::TiXmlNode::lastChild, and RTT::marsh::TiXmlNode::next.
Referenced by RTT::marsh::TiXmlElement::ClearThis(), LoadFile(), RTT::marsh::TiXmlComment::operator=(), RTT::marsh::TiXmlDeclaration::operator=(), and operator=().
|
inline |
If you have handled the error, it can be reset with this call.
The error state is automatically cleared if you Parse a new XML block.
Definition at line 1379 of file tinyxml.h.
Referenced by TiXmlDocument().
|
protectedvirtual |
Create an exact duplicate of this node and return it.
The memory must be deleted by the caller.
Implements RTT::marsh::TiXmlNode.
Definition at line 1231 of file tinyxml.cpp.
References TiXmlDocument().
|
inlineinherited |
|
staticprotectedinherited |
Definition at line 127 of file tinyxmlparser.cpp.
Referenced by RTT::marsh::TiXmlBase::GetEntity().
|
protectedinherited |
Definition at line 209 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::SetValue(), RTT::marsh::TiXmlBase::userData, and RTT::marsh::TiXmlNode::value.
Referenced by RTT::marsh::TiXmlElement::CopyTo(), RTT::marsh::TiXmlComment::CopyTo(), RTT::marsh::TiXmlText::CopyTo(), RTT::marsh::TiXmlDeclaration::CopyTo(), RTT::marsh::TiXmlUnknown::CopyTo(), and SaveFile().
|
inline |
If an error occurs, Error will be set to true.
Also,
Definition at line 1328 of file tinyxml.h.
Referenced by LoadFile().
|
inline |
The column where the error occured. See ErrorRow()
|
inline |
Contains a textual (english) description of the error if one occurs.
Definition at line 1331 of file tinyxml.h.
Referenced by RTT::marsh::TinyDemarshaller::TinyDemarshaller().
|
inline |
Generally, you probably want the error string ( ErrorDesc() ).
But if you prefer the ErrorId, this function will fetch it.
|
inline |
Returns the location (if known) of the error.
The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.)
|
inlineinherited |
The first child of this node. Will be null if there are no children.
Definition at line 525 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlHandle::Child(), RTT::marsh::TiXmlHandle::FirstChild(), RTT::marsh::TiXmlNode::FirstChildElement(), RTT::marsh::TiXmlElement::GetText(), RTT::marsh::TiXmlNode::IterateChildren(), RTT::marsh::Tiny2CPFHandler::populateBag(), Print(), and StreamOut().
|
inlineinherited |
|
inherited |
The first child of this node with the matching 'value'. Will be null if none found.
Definition at line 365 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::firstChild, RTT::marsh::TiXmlNode::next, and RTT::marsh::TiXmlNode::Value().
|
inherited |
The first child of this node with the matching 'value'. Will be null if none found.
Definition at line 377 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::firstChild, RTT::marsh::TiXmlNode::next, and RTT::marsh::TiXmlNode::Value().
|
inherited |
Convenience function to get through elements.
Definition at line 518 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::ToElement().
Referenced by RTT::marsh::TiXmlHandle::ChildElement(), and RTT::marsh::TiXmlHandle::FirstChildElement().
|
inherited |
Definition at line 532 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::ToElement().
|
inherited |
Convenience function to get through elements.
Definition at line 546 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::ToElement().
|
inherited |
Definition at line 560 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::ToElement().
|
inlinestaticprotectedinherited |
Definition at line 323 of file tinyxml.h.
References RTT::marsh::TIXML_ENCODING_UTF8, TIXML_OSTREAM, and TIXML_STRING.
Referenced by RTT::marsh::TiXmlBase::ReadText().
|
inherited |
Return a pointer to the Document this node lives in.
Returns null if not in a document.
Definition at line 631 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::parent, and RTT::marsh::TiXmlNode::ToDocument().
Referenced by RTT::marsh::TiXmlNode::LinkEndChild(), and RTT::marsh::TiXmlElement::SetAttribute().
|
inherited |
Definition at line 643 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::parent, and RTT::marsh::TiXmlNode::ToDocument().
|
staticprotectedinherited |
Definition at line 467 of file tinyxmlparser.cpp.
References RTT::marsh::TiXmlBase::ConvertUTF32ToUTF8(), RTT::marsh::TIXML_ENCODING_UTF8, and TIXML_STRING.
|
inlineinherited |
|
protectedinherited |
Definition at line 843 of file tinyxmlparser.cpp.
References RTT::marsh::TiXmlBase::IsAlpha(), RTT::marsh::TiXmlBase::IsWhiteSpace(), RTT::marsh::TiXmlNode::parent, RTT::marsh::TiXmlText::SetCDATA(), SetError(), RTT::marsh::TiXmlBase::SkipWhiteSpace(), RTT::marsh::TiXmlBase::StringEqual(), RTT::marsh::TIXML_DEFAULT_ENCODING, RTT::marsh::TIXML_ENCODING_UNKNOWN, RTT::marsh::TiXmlBase::TIXML_ERROR_EMBEDDED_NULL, RTT::marsh::TiXmlBase::TIXML_ERROR_OUT_OF_MEMORY, TIXML_STRING, and RTT::marsh::TiXmlBase::TiXmlElement.
|
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 289 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::Clone(), RTT::marsh::TiXmlNode::lastChild, RTT::marsh::TiXmlNode::next, RTT::marsh::TiXmlNode::parent, and RTT::marsh::TiXmlNode::prev.
|
inherited |
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 263 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::Clone(), RTT::marsh::TiXmlNode::firstChild, RTT::marsh::TiXmlNode::next, RTT::marsh::TiXmlNode::parent, and RTT::marsh::TiXmlNode::prev.
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 253 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::Clone(), and RTT::marsh::TiXmlNode::LinkEndChild().
|
staticprotectedinherited |
Definition at line 168 of file tinyxmlparser.cpp.
Referenced by RTT::marsh::TiXmlNode::Identify(), and RTT::marsh::TiXmlBase::ReadName().
|
staticprotectedinherited |
Definition at line 189 of file tinyxmlparser.cpp.
Referenced by RTT::marsh::TiXmlBase::ReadName().
|
inlinestaticprotectedinherited |
Definition at line 284 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlText::Blank(), RTT::marsh::TiXmlNode::Identify(), RTT::marsh::TiXmlAttribute::Parse(), RTT::marsh::TiXmlDeclaration::Parse(), RTT::marsh::TiXmlBase::ReadText(), and RTT::marsh::TiXmlBase::SkipWhiteSpace().
|
inlinestaticprotectedinherited |
Definition at line 288 of file tinyxml.h.
References TIXML_OSTREAM, and TIXML_STRING.
|
inlinestaticinherited |
Return the current white space setting.
Definition at line 215 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlElement::ReadValue().
|
inherited |
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 411 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::parent.
Definition at line 424 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::parent.
|
inherited |
This flavor of IterateChildren searches for children with a particular 'value'.
Definition at line 437 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::parent.
|
inherited |
Definition at line 450 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::parent.
|
inlineinherited |
|
inlineinherited |
|
inherited |
Definition at line 389 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::lastChild, RTT::marsh::TiXmlNode::prev, and RTT::marsh::TiXmlNode::Value().
|
inherited |
The last child of this node matching 'value'. Will be null if there are no children.
Definition at line 400 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::lastChild, RTT::marsh::TiXmlNode::prev, and RTT::marsh::TiXmlNode::Value().
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 233 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::firstChild, RTT::marsh::TiXmlNode::GetDocument(), RTT::marsh::TiXmlNode::lastChild, RTT::marsh::TiXmlNode::next, RTT::marsh::TiXmlNode::parent, and RTT::marsh::TiXmlNode::prev.
Referenced by RTT::marsh::TiXmlElement::CopyTo(), RTT::marsh::TiXmlNode::InsertEndChild(), and SaveFile().
bool RTT::marsh::TiXmlDocument::LoadFile | ( | TiXmlEncoding | encoding = TIXML_DEFAULT_ENCODING | ) |
Load a file using the current document value.
Returns true if successful. Will delete any existing document data before loading.
Definition at line 1020 of file tinyxml.cpp.
References RTT::marsh::TiXmlBase::StringToBuffer::buffer, and RTT::marsh::TiXmlNode::value.
Referenced by LoadFile(), and RTT::marsh::TinyDemarshaller::TinyDemarshaller().
bool RTT::marsh::TiXmlDocument::LoadFile | ( | const char * | filename, |
TiXmlEncoding | encoding = TIXML_DEFAULT_ENCODING |
||
) |
Load a file using the given filename. Returns true if successful.
Definition at line 1043 of file tinyxml.cpp.
References LoadFile(), SetError(), RTT::marsh::TIXML_ENCODING_UNKNOWN, RTT::marsh::TiXmlBase::TIXML_ERROR_OPENING_FILE, and RTT::marsh::TiXmlNode::value.
bool RTT::marsh::TiXmlDocument::LoadFile | ( | FILE * | file, |
TiXmlEncoding | encoding = TIXML_DEFAULT_ENCODING |
||
) |
Load a file using the given FILE*.
Returns true if successful. Note that this method doesn't stream - the entire object pointed at by the FILE* will be interpreted as an XML file. TinyXML doesn't stream in XML from the current file location. Streaming may be added in the future.
Definition at line 1071 of file tinyxml.cpp.
References RTT::marsh::TiXmlCursor::Clear(), RTT::marsh::TiXmlNode::Clear(), Error(), RTT::marsh::TiXmlBase::location, Parse(), SetError(), RTT::marsh::TIXML_ENCODING_UNKNOWN, RTT::marsh::TiXmlBase::TIXML_ERROR_DOCUMENT_EMPTY, RTT::marsh::TiXmlBase::TIXML_ERROR_OPENING_FILE, and TIXML_STRING.
|
inlineinherited |
Navigate to a sibling node.
Definition at line 621 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlHandle::Child(), RTT::marsh::TiXmlElement::CopyTo(), RTT::marsh::TiXmlNode::FirstChildElement(), RTT::marsh::TiXmlNode::IterateChildren(), RTT::marsh::TiXmlNode::NextSiblingElement(), RTT::marsh::Tiny2CPFHandler::populateBag(), RTT::marsh::TiXmlElement::Print(), Print(), SaveFile(), RTT::marsh::TiXmlElement::StreamOut(), and StreamOut().
|
inlineinherited |
|
inherited |
Navigate to a sibling node with the given 'value'.
Definition at line 463 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::next, and RTT::marsh::TiXmlNode::Value().
|
inherited |
Definition at line 474 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::next, and RTT::marsh::TiXmlNode::Value().
|
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 574 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::ToElement().
Referenced by RTT::marsh::TiXmlHandle::ChildElement().
|
inherited |
Definition at line 588 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::ToElement().
|
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 602 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::ToElement().
|
inherited |
Definition at line 616 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlNode::ToElement().
|
inlineinherited |
void RTT::marsh::TiXmlDocument::operator= | ( | const TiXmlDocument & | copy | ) |
Definition at line 1013 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::Clear().
|
inlineinherited |
|
inlineinherited |
|
virtual |
Parse the given null terminated block of xml data.
Passing in an encoding to this method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml to use that encoding, regardless of what TinyXml might otherwise try to detect.
Implements RTT::marsh::TiXmlBase.
Definition at line 729 of file tinyxmlparser.cpp.
References RTT::marsh::TiXmlCursor::Clear(), RTT::marsh::TiXmlCursor::col, RTT::marsh::TiXmlParsingData::Cursor(), RTT::marsh::TiXmlDeclaration::Encoding(), RTT::marsh::TiXmlBase::location, RTT::marsh::TiXmlBase::Parse(), RTT::marsh::TiXmlCursor::row, RTT::marsh::TiXmlBase::SkipWhiteSpace(), RTT::marsh::TiXmlBase::StringEqual(), RTT::marsh::TIXML_ENCODING_LEGACY, RTT::marsh::TIXML_ENCODING_UNKNOWN, RTT::marsh::TIXML_ENCODING_UTF8, RTT::marsh::TiXmlBase::TIXML_ERROR_DOCUMENT_EMPTY, and RTT::marsh::TiXmlNode::ToDeclaration().
Referenced by LoadFile().
|
inlineinherited |
|
inlineinherited |
|
inherited |
Navigate to a sibling node.
Definition at line 485 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::prev, and RTT::marsh::TiXmlNode::Value().
|
inherited |
Definition at line 496 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::prev, and RTT::marsh::TiXmlNode::Value().
|
inline |
Dump the document to standard out.
Definition at line 1387 of file tinyxml.h.
References Print().
Referenced by Print(), and SaveFile().
|
virtual |
Print this Document to a FILE stream.
Implements RTT::marsh::TiXmlBase.
Definition at line 1242 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::NextSibling(), and RTT::marsh::TiXmlBase::Print().
|
staticprotectedinherited |
Definition at line 75 of file tinyxml.cpp.
References TIXML_STRING.
Referenced by RTT::marsh::TiXmlAttribute::Print(), RTT::marsh::TiXmlText::Print(), RTT::marsh::TiXmlAttribute::StreamOut(), RTT::marsh::TiXmlText::StreamOut(), and RTT::marsh::TiXmlDeclaration::StreamOut().
|
staticprotectedinherited |
Definition at line 82 of file tinyxml.cpp.
|
staticprotectedinherited |
Definition at line 437 of file tinyxmlparser.cpp.
References RTT::marsh::TiXmlBase::IsAlpha(), and RTT::marsh::TiXmlBase::IsAlphaNum().
Referenced by RTT::marsh::TiXmlAttribute::Parse(), and RTT::marsh::TiXmlElement::Parse().
|
staticprotectedinherited |
Definition at line 601 of file tinyxmlparser.cpp.
References RTT::marsh::TiXmlBase::GetChar(), RTT::marsh::TiXmlBase::IsWhiteSpace(), RTT::marsh::TiXmlBase::SkipWhiteSpace(), RTT::marsh::TiXmlBase::StringEqual(), RTT::marsh::TIXML_DEFAULT_ENCODING, RTT::marsh::TIXML_ENCODING_UNKNOWN, RTT::marsh::TiXmlBase::TIXML_ERROR, RTT::marsh::TiXmlBase::TIXML_ERROR_EMBEDDED_NULL, RTT::marsh::TiXmlBase::TIXML_ERROR_PARSING_EMPTY, TIXML_STRING, and RTT::marsh::TiXmlNode::ToElement().
Referenced by RTT::marsh::TiXmlAttribute::Parse(), RTT::marsh::TiXmlComment::Parse(), and RTT::marsh::TiXmlText::Parse().
|
inherited |
Delete a child of this node.
Definition at line 343 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::firstChild, RTT::marsh::TiXmlNode::lastChild, RTT::marsh::TiXmlNode::next, RTT::marsh::TiXmlNode::parent, and RTT::marsh::TiXmlNode::prev.
|
inherited |
Replace a child of this node.
Returns a pointer to the new object or NULL if an error occured.
Definition at line 315 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::Clone(), RTT::marsh::TiXmlNode::firstChild, RTT::marsh::TiXmlNode::lastChild, RTT::marsh::TiXmlNode::next, RTT::marsh::TiXmlNode::parent, and RTT::marsh::TiXmlNode::prev.
|
inline |
|
inline |
|
inlineinherited |
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.
Definition at line 235 of file tinyxml.h.
Referenced by RTT::marsh::Tiny2CPFHandler::populateBag().
bool RTT::marsh::TiXmlDocument::SaveFile | ( | ) | const |
Save a file using the current document value. Returns true if successful.
Definition at line 1032 of file tinyxml.cpp.
References RTT::marsh::TiXmlBase::StringToBuffer::buffer, and RTT::marsh::TiXmlNode::value.
Referenced by SaveFile().
bool RTT::marsh::TiXmlDocument::SaveFile | ( | const char * | filename | ) | const |
Save a file using the given filename. Returns true if successful.
Definition at line 1185 of file tinyxml.cpp.
References SaveFile().
bool RTT::marsh::TiXmlDocument::SaveFile | ( | FILE * | fp | ) | const |
Save a file using the given FILE*. Returns true if successful.
Definition at line 1199 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::Clone(), RTT::marsh::TiXmlNode::CopyTo(), RTT::marsh::TiXmlNode::firstChild, RTT::marsh::TiXmlNode::LinkEndChild(), RTT::marsh::TiXmlNode::NextSibling(), Print(), RTT::marsh::TIXML_UTF_LEAD_0, RTT::marsh::TIXML_UTF_LEAD_1, and RTT::marsh::TIXML_UTF_LEAD_2.
|
inlinestaticinherited |
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 values is not thread safe.
void RTT::marsh::TiXmlDocument::SetError | ( | int | err, |
const char * | errorLocation, | ||
TiXmlParsingData * | prevData, | ||
TiXmlEncoding | encoding | ||
) |
Definition at line 823 of file tinyxmlparser.cpp.
References RTT::marsh::TiXmlParsingData::Cursor(), RTT::marsh::TiXmlBase::errorString, RTT::marsh::TiXmlParsingData::Stamp(), and RTT::marsh::TiXmlBase::TIXML_ERROR_STRING_COUNT.
Referenced by RTT::marsh::TiXmlNode::Identify(), LoadFile(), RTT::marsh::TiXmlAttribute::Parse(), RTT::marsh::TiXmlElement::Parse(), RTT::marsh::TiXmlComment::Parse(), RTT::marsh::TiXmlText::Parse(), RTT::marsh::TiXmlDeclaration::Parse(), RTT::marsh::TiXmlUnknown::Parse(), RTT::marsh::TiXmlElement::ReadValue(), and RTT::marsh::TiXmlElement::SetAttribute().
|
inline |
SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to report the correct values for row and column.
It does not change the output or input in any way.
By calling this method, with a tab size greater than 0, the row and column of each node and attribute is stored when the file is loaded. Very useful for tracking the DOM back in to the source file.
The tab size is required for calculating the location of nodes. If not set, the default of 4 is used. The tabsize is set per document. Setting the tabsize to 0 disables row/column tracking.
Note that row and column tracking is not supported when using operator>>.
The tab size needs to be enabled before the parse or load. Correct usage:
TiXmlDocument doc; doc.SetTabSize( 8 ); doc.Load( "myfile.xml" );
|
inlineinherited |
|
inlineinherited |
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 511 of file tinyxml.h.
References RTT::marsh::TiXmlCursor::Clear().
Referenced by RTT::marsh::TiXmlNode::CopyTo(), RTT::marsh::TiXmlAttribute::SetDoubleValue(), and RTT::marsh::TiXmlAttribute::SetIntValue().
|
staticprotectedinherited |
Definition at line 353 of file tinyxmlparser.cpp.
References RTT::marsh::TiXmlBase::IsWhiteSpace(), RTT::marsh::TIXML_ENCODING_UTF8, TIXML_STRING, and RTT::marsh::TIXML_UTF_LEAD_2.
Referenced by RTT::marsh::TiXmlNode::Identify(), RTT::marsh::TiXmlAttribute::Parse(), RTT::marsh::TiXmlElement::Parse(), RTT::marsh::TiXmlComment::Parse(), RTT::marsh::TiXmlDeclaration::Parse(), RTT::marsh::TiXmlUnknown::Parse(), Parse(), RTT::marsh::TiXmlBase::ReadText(), and RTT::marsh::TiXmlElement::ReadValue().
|
protectedvirtual |
Implements RTT::marsh::TiXmlBase.
Definition at line 1252 of file tinyxml.cpp.
References RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::NextSibling(), RTT::marsh::TiXmlBase::StreamOut(), and RTT::marsh::TiXmlNode::ToElement().
|
staticprotectedinherited |
Definition at line 561 of file tinyxmlparser.cpp.
References RTT::marsh::TiXmlBase::ToLower().
Referenced by RTT::marsh::TiXmlNode::Identify(), RTT::marsh::TiXmlElement::Parse(), RTT::marsh::TiXmlComment::Parse(), RTT::marsh::TiXmlText::Parse(), RTT::marsh::TiXmlDeclaration::Parse(), Parse(), RTT::marsh::TiXmlBase::ReadText(), and RTT::marsh::TiXmlElement::ReadValue().
|
inlinevirtualinherited |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in RTT::marsh::TiXmlComment.
|
inlinevirtualinherited |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in RTT::marsh::TiXmlComment.
|
inlinevirtualinherited |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in RTT::marsh::TiXmlDeclaration.
Definition at line 680 of file tinyxml.h.
Referenced by Parse().
|
inlinevirtualinherited |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in RTT::marsh::TiXmlDeclaration.
Definition at line 687 of file tinyxml.h.
References TIXML_STRING.
|
inlinevirtual |
Cast to a more defined type. Will return null not of the requested type.
Reimplemented from RTT::marsh::TiXmlNode.
|
inlinevirtual |
Cast to a more defined type. Will return null not of the requested type.
Reimplemented from RTT::marsh::TiXmlNode.
Definition at line 1395 of file tinyxml.h.
References TIXML_OSTREAM, and TIXML_STRING.
|
inlinevirtualinherited |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in RTT::marsh::TiXmlElement.
Definition at line 676 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlNode::FirstChildElement(), RTT::marsh::TiXmlNode::NextSiblingElement(), RTT::marsh::Tiny2CPFHandler::populateBag(), RTT::marsh::TiXmlBase::ReadText(), and StreamOut().
|
inlinevirtualinherited |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in RTT::marsh::TiXmlElement.
|
inlinestaticprotectedinherited |
Definition at line 384 of file tinyxml.h.
References RTT::marsh::TIXML_ENCODING_UTF8.
Referenced by RTT::marsh::TiXmlBase::StringEqual().
|
inlinevirtualinherited |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in RTT::marsh::TiXmlText.
Definition at line 679 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlElement::GetText(), RTT::marsh::Tiny2CPFHandler::populateBag(), and RTT::marsh::TiXmlElement::Print().
|
inlinevirtualinherited |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in RTT::marsh::TiXmlText.
|
inlinevirtualinherited |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in RTT::marsh::TiXmlUnknown.
|
inlinevirtualinherited |
Cast to a more defined type. Will return null if not of the requested type.
Reimplemented in RTT::marsh::TiXmlUnknown.
|
inlineinherited |
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 664 of file tinyxml.h.
Referenced by RTT::marsh::Tiny2CPFHandler::populateBag().
|
inlineinherited |
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 492 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlElement::Clone(), RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlElement::GetText(), RTT::marsh::TiXmlNode::LastChild(), RTT::marsh::TiXmlNode::NextSibling(), RTT::marsh::Tiny2CPFHandler::populateBag(), and RTT::marsh::TiXmlNode::PreviousSibling().
|
staticprotectedinherited |
Definition at line 373 of file tinyxml.h.
Referenced by SetError().
|
protectedinherited |
Definition at line 712 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlNode::Clear(), RTT::marsh::TiXmlElement::CopyTo(), RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::InsertBeforeChild(), RTT::marsh::TiXmlNode::LinkEndChild(), RTT::marsh::TiXmlElement::Print(), RTT::marsh::TiXmlNode::RemoveChild(), RTT::marsh::TiXmlNode::ReplaceChild(), SaveFile(), RTT::marsh::TiXmlElement::StreamOut(), RTT::marsh::TiXmlElement::TiXmlElement(), RTT::marsh::TiXmlNode::TiXmlNode(), and RTT::marsh::TiXmlNode::~TiXmlNode().
|
protectedinherited |
Definition at line 713 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlNode::Clear(), RTT::marsh::TiXmlNode::InsertAfterChild(), RTT::marsh::TiXmlNode::LastChild(), RTT::marsh::TiXmlNode::LinkEndChild(), RTT::marsh::TiXmlElement::Print(), RTT::marsh::TiXmlNode::RemoveChild(), RTT::marsh::TiXmlNode::ReplaceChild(), RTT::marsh::TiXmlElement::TiXmlElement(), and RTT::marsh::TiXmlNode::TiXmlNode().
|
protectedinherited |
Definition at line 375 of file tinyxml.h.
Referenced by LoadFile(), RTT::marsh::TiXmlAttribute::Parse(), RTT::marsh::TiXmlElement::Parse(), RTT::marsh::TiXmlComment::Parse(), RTT::marsh::TiXmlText::Parse(), RTT::marsh::TiXmlDeclaration::Parse(), RTT::marsh::TiXmlUnknown::Parse(), and Parse().
|
protectedinherited |
Definition at line 718 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlNode::Clear(), RTT::marsh::TiXmlNode::FirstChild(), RTT::marsh::TiXmlNode::InsertAfterChild(), RTT::marsh::TiXmlNode::InsertBeforeChild(), RTT::marsh::TiXmlNode::LinkEndChild(), RTT::marsh::TiXmlAttribute::Next(), RTT::marsh::TiXmlNode::NextSibling(), RTT::marsh::TiXmlNode::RemoveChild(), RTT::marsh::TiXmlNode::ReplaceChild(), RTT::marsh::TiXmlNode::TiXmlNode(), and RTT::marsh::TiXmlNode::~TiXmlNode().
|
protectedinherited |
Definition at line 709 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlNode::GetDocument(), RTT::marsh::TiXmlNode::Identify(), RTT::marsh::TiXmlNode::InsertAfterChild(), RTT::marsh::TiXmlNode::InsertBeforeChild(), RTT::marsh::TiXmlNode::IterateChildren(), RTT::marsh::TiXmlNode::LinkEndChild(), RTT::marsh::TiXmlNode::RemoveChild(), RTT::marsh::TiXmlNode::ReplaceChild(), and RTT::marsh::TiXmlNode::TiXmlNode().
|
protectedinherited |
Definition at line 717 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlNode::InsertAfterChild(), RTT::marsh::TiXmlNode::InsertBeforeChild(), RTT::marsh::TiXmlNode::LastChild(), RTT::marsh::TiXmlNode::LinkEndChild(), RTT::marsh::TiXmlAttribute::Previous(), RTT::marsh::TiXmlNode::PreviousSibling(), RTT::marsh::TiXmlNode::RemoveChild(), RTT::marsh::TiXmlNode::ReplaceChild(), and RTT::marsh::TiXmlNode::TiXmlNode().
|
protectedinherited |
Definition at line 710 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlNode::TiXmlNode().
|
protectedinherited |
Field containing a generic user pointer.
Definition at line 378 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlNode::CopyTo().
|
staticinherited |
|
protectedinherited |
Definition at line 715 of file tinyxml.h.
Referenced by RTT::marsh::TiXmlNode::CopyTo(), RTT::marsh::TiXmlAttribute::DoubleValue(), RTT::marsh::TiXmlAttribute::IntValue(), LoadFile(), RTT::marsh::TiXmlAttribute::Next(), RTT::marsh::TiXmlAttribute::Previous(), RTT::marsh::TiXmlAttribute::Print(), RTT::marsh::TiXmlElement::Print(), RTT::marsh::TiXmlComment::Print(), RTT::marsh::TiXmlText::Print(), RTT::marsh::TiXmlUnknown::Print(), RTT::marsh::TiXmlAttribute::QueryDoubleValue(), RTT::marsh::TiXmlAttribute::QueryIntValue(), SaveFile(), RTT::marsh::TiXmlAttribute::StreamOut(), RTT::marsh::TiXmlElement::StreamOut(), RTT::marsh::TiXmlComment::StreamOut(), RTT::marsh::TiXmlText::StreamOut(), RTT::marsh::TiXmlUnknown::StreamOut(), TiXmlDocument(), and RTT::marsh::TiXmlElement::TiXmlElement().