#include <tinyxml.h>


Public Member Functions | |
| TiXmlDocument () | |
| Create an empty document, that has no name. | |
| TiXmlDocument (const char *documentName) | |
| Create a document with a name. The name of the document is also the filename of the xml. | |
| TiXmlDocument (const std::string &documentName) | |
| Constructor. | |
| virtual | ~TiXmlDocument () |
| bool | LoadFile () |
| Load a file using the current document value. | |
| bool | SaveFile () const |
| Save a file using the current document value. Returns true if successful. | |
| bool | LoadFile (const char *filename) |
| Load a file using the given filename. Returns true if successful. | |
| bool | SaveFile (const char *filename) const |
| Save a file using the given filename. Returns true if successful. | |
| bool | LoadFile (const std::string &filename) |
| bool | SaveFile (const std::string &filename) const |
| < STL std::string version. | |
| virtual const char * | Parse (const char *p) |
| Parse the given null terminated block of xml data. | |
| TiXmlElement * | RootElement () const |
| Get the root element -- the only top level element -- of the document. | |
| bool | Error () const |
| If, during parsing, a error occurs, Error will be set to true. | |
| const char * | ErrorDesc () const |
| Contains a textual (english) description of the error if one occurs. | |
| const int | ErrorId () const |
| Generally, you probably want the error string ( ErrorDesc() ). | |
| void | ClearError () |
| If you have handled the error, it can be reset with this call. | |
| void | Print () const |
| Dump the document to standard out. | |
| virtual void | Print (FILE *cfile, int depth=0) const |
| All TinyXml classes can print themselves to a filestream. | |
| void | SetError (int err) |
Protected Member Functions | |
| virtual void | StreamOut (TIXML_OSTREAM *out) const |
| virtual TiXmlNode * | Clone () const |
| virtual void | StreamIn (TIXML_ISTREAM *in, TIXML_STRING *tag) |
Private Attributes | |
| bool | error |
| int | errorId |
| TIXML_STRING | errorDesc |
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.
Definition at line 897 of file tinyxml.h.
| TiXmlDocument::TiXmlDocument | ( | ) |
Create an empty document, that has no name.
Definition at line 697 of file tinyxml.cpp.
References error.
Referenced by Clone().
| 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 703 of file tinyxml.cpp.
References error.
| TiXmlDocument::TiXmlDocument | ( | const std::string & | documentName | ) | [inline] |
| virtual TiXmlDocument::~TiXmlDocument | ( | ) | [inline, virtual] |
| void TiXmlDocument::ClearError | ( | ) | [inline] |
| TiXmlNode * TiXmlDocument::Clone | ( | ) | const [protected, virtual] |
Implements TiXmlNode.
Definition at line 797 of file tinyxml.cpp.
References TiXmlNode::Clone(), TiXmlNode::CopyToClone(), error, errorDesc, TiXmlNode::firstChild, TiXmlNode::LinkEndChild(), TiXmlNode::NextSibling(), and TiXmlDocument().
| bool TiXmlDocument::Error | ( | ) | const [inline] |
If, during parsing, a error occurs, Error will be set to true.
Definition at line 951 of file tinyxml.h.
References error.
Referenced by LoadFile(), and Ogre::DotSceneLoader::parseDotScene().
| const char* TiXmlDocument::ErrorDesc | ( | ) | const [inline] |
| const int TiXmlDocument::ErrorId | ( | ) | const [inline] |
Generally, you probably want the error string ( ErrorDesc() ).
But if you prefer the ErrorId, this function will fetch it.
| bool TiXmlDocument::LoadFile | ( | const std::string & | filename | ) | [inline] |
| bool TiXmlDocument::LoadFile | ( | const char * | filename | ) |
Load a file using the given filename. Returns true if successful.
Definition at line 727 of file tinyxml.cpp.
References TiXmlNode::Clear(), Error(), Parse(), SetError(), TiXmlBase::TIXML_ERROR_OPENING_FILE, and TIXML_STRING.
| bool TiXmlDocument::LoadFile | ( | ) |
Load a file using the current document value.
Returns true if successful. Will delete any existing document data before loading.
Definition at line 710 of file tinyxml.cpp.
| const char * TiXmlDocument::Parse | ( | const char * | p | ) | [virtual] |
Parse the given null terminated block of xml data.
Implements TiXmlBase.
Definition at line 342 of file tinyxmlparser.cpp.
References TiXmlNode::Identify(), TiXmlNode::LinkEndChild(), TiXmlBase::Parse(), SetError(), TiXmlBase::SkipWhiteSpace(), and TiXmlBase::TIXML_ERROR_DOCUMENT_EMPTY.
Referenced by LoadFile(), and Ogre::DotSceneLoader::parseDotScene().
| void TiXmlDocument::Print | ( | FILE * | cfile, | |
| int | depth = 0 | |||
| ) | const [virtual] |
All TinyXml classes can print themselves to a filestream.
This is a formatted print, and will insert tabs and newlines.
(For an unformatted stream, use the << operator.)
Implements TiXmlBase.
Definition at line 816 of file tinyxml.cpp.
References TiXmlNode::FirstChild(), TiXmlNode::NextSibling(), and TiXmlBase::Print().
| void TiXmlDocument::Print | ( | ) | const [inline] |
Dump the document to standard out.
Definition at line 965 of file tinyxml.h.
References Print().
Referenced by Print(), and SaveFile().
| TiXmlElement* TiXmlDocument::RootElement | ( | ) | const [inline] |
Get the root element -- the only top level element -- of the document.
In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level.
Definition at line 948 of file tinyxml.h.
References TiXmlNode::FirstChildElement().
Referenced by Ogre::DotSceneLoader::parseDotScene().
| bool TiXmlDocument::SaveFile | ( | const std::string & | filename | ) | const [inline] |
| bool TiXmlDocument::SaveFile | ( | const char * | filename | ) | const |
Save a file using the given filename. Returns true if successful.
Definition at line 783 of file tinyxml.cpp.
References Print().
| bool TiXmlDocument::SaveFile | ( | ) | const |
Save a file using the current document value. Returns true if successful.
Definition at line 719 of file tinyxml.cpp.
| void TiXmlDocument::SetError | ( | int | err | ) | [inline] |
Definition at line 970 of file tinyxml.h.
References error.
Referenced by TiXmlNode::Identify(), LoadFile(), TiXmlDeclaration::Parse(), TiXmlAttribute::Parse(), TiXmlComment::Parse(), TiXmlUnknown::Parse(), TiXmlElement::Parse(), Parse(), TiXmlElement::ReadValue(), TiXmlElement::SetAttribute(), and StreamIn().
| void TiXmlDocument::StreamIn | ( | TIXML_ISTREAM * | in, | |
| TIXML_STRING * | tag | |||
| ) | [protected, virtual] |
Implements TiXmlNode.
Definition at line 284 of file tinyxmlparser.cpp.
References TiXmlNode::Identify(), SetError(), TiXmlNode::StreamIn(), TiXmlBase::StreamTo(), TiXmlBase::TIXML_ERROR, TiXmlBase::TIXML_ERROR_PARSING_EMPTY, and TiXmlNode::ToElement().
| void TiXmlDocument::StreamOut | ( | TIXML_OSTREAM * | out | ) | const [protected, virtual] |
Implements TiXmlBase.
Definition at line 826 of file tinyxml.cpp.
References TiXmlNode::FirstChild(), TiXmlNode::NextSibling(), TiXmlBase::StreamOut(), and TiXmlNode::ToElement().
bool TiXmlDocument::error [private] |
TIXML_STRING TiXmlDocument::errorDesc [private] |
int TiXmlDocument::errorId [private] |
1.5.7.1