TiXml.h
/*
www.sourceforge.net/projects/tinyxml
Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#ifndef __EDELIB_TIXML_H__
#define __EDELIB_TIXML_H__
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
// Help out windows:
#if defined( _DEBUG ) && !defined( DEBUG )
#define DEBUG
#endif
#ifdef TIXML_USE_STL
#include <string>
#include <iostream>
#include <sstream>
#define TIXML_STRING std::string
#else
#include "String.h"
#define TIXML_STRING EDELIB_NS_PREPEND(String)
#endif
// Deprecated library function hell. Compilers want to use the
// new safe versions. This probably doesn't fully address the problem,
// but it gets closer. There are too many compilers for me to fully
// test. If you get compilation troubles, undefine TIXML_SAFE
#define TIXML_SAFE
#ifdef TIXML_SAFE
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
// Microsoft visual studio, version 2005 and higher.
#define TIXML_SNPRINTF _snprintf_s
#define TIXML_SNSCANF _snscanf_s
#elif defined(_MSC_VER) && (_MSC_VER >= 1200 )
// Microsoft visual studio, version 6 and higher.
//#pragma message( "Using _sn* functions." )
#define TIXML_SNPRINTF _snprintf
#define TIXML_SNSCANF _snscanf
#elif defined(__GNUC__) && (__GNUC__ >= 3 )
// GCC version 3 and higher.s
//#warning( "Using sn* functions." )
#define TIXML_SNPRINTF snprintf
#define TIXML_SNSCANF snscanf
#endif
#endif
class TiXmlDocument;
class TiXmlElement;
class TiXmlComment;
class TiXmlUnknown;
class TiXmlAttribute;
class TiXmlText;
class TiXmlDeclaration;
class TiXmlParsingData;
const int TIXML_MAJOR_VERSION = 2;
const int TIXML_MINOR_VERSION = 5;
const int TIXML_PATCH_VERSION = 2;
#ifndef SKIP_DOCS
/*
* Internal structure for tracking location of items
* in the XML file.
*/
struct TiXmlCursor
{
TiXmlCursor() { Clear(); }
void Clear() { row = col = -1; }
int row; // 0 based.
int col; // 0 based.
};
#endif
class TiXmlVisitor
{
public:
virtual ~TiXmlVisitor() {}
virtual bool VisitEnter( const TiXmlDocument& doc ) { return true; }
virtual bool VisitExit( const TiXmlDocument& doc ) { return true; }
virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) { return true; }
virtual bool VisitExit( const TiXmlElement& element ) { return true; }
virtual bool Visit( const TiXmlDeclaration& declaration ) { return true; }
virtual bool Visit( const TiXmlText& text ) { return true; }
virtual bool Visit( const TiXmlComment& comment ) { return true; }
virtual bool Visit( const TiXmlUnknown& unknown ) { return true; }
};
// Only used by Attribute::Query functions
enum
{
TIXML_SUCCESS,
TIXML_NO_ATTRIBUTE,
TIXML_WRONG_TYPE
};
// Used by the parsing routines.
enum TiXmlEncoding
{
TIXML_ENCODING_UNKNOWN,
TIXML_ENCODING_UTF8,
TIXML_ENCODING_LEGACY
};
const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN;
class TiXmlBase
{
friend class TiXmlNode;
friend class TiXmlElement;
friend class TiXmlDocument;
public:
TiXmlBase() : userData(0) {}
virtual ~TiXmlBase() {}
virtual void Print( FILE* cfile, int depth ) const = 0;
static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; }
static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; }
int Row() const { return location.row + 1; }
int Column() const { return location.col + 1; }
void SetUserData( void* user ) { userData = user; }
void* GetUserData() { return userData; }
const void* GetUserData() const { return userData; }
#ifndef SKIP_DOCS
// Table that returs, for a given lead byte, the total number of bytes
// in the UTF-8 sequence.
static const int utf8ByteTable[256];
virtual const char* Parse( const char* p,
TiXmlParsingData* data,
TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0;
#endif
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_DOCUMENT_TOP_ONLY,
TIXML_ERROR_STRING_COUNT
};
protected:
#ifndef SKIP_DOCS
static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding );
inline static bool IsWhiteSpace( char c )
{
return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' );
}
inline static bool IsWhiteSpace( int c )
{
if ( c < 256 )
return IsWhiteSpace( (char) c );
return false; // Again, only truly correct for English/Latin...but usually works.
}
#ifdef TIXML_USE_STL
static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag );
static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag );
#endif
#endif
static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding );
static const char* ReadText( const char* in, // where to start
TIXML_STRING* text, // the string read
bool ignoreWhiteSpace, // whether to keep the white space
const char* endTag, // what ends this text
bool ignoreCase, // whether to ignore case in the end tag
TiXmlEncoding encoding ); // the current encoding
static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding );
inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding )
{
assert( p );
if ( encoding == TIXML_ENCODING_UTF8 )
{
*length = utf8ByteTable[ *((const unsigned char*)p) ];
assert( *length >= 0 && *length < 5 );
}
else
{
*length = 1;
}
if ( *length == 1 )
{
if ( *p == '&' )
return GetEntity( p, _value, length, encoding );
*_value = *p;
return p+1;
}
else if ( *length )
{
//strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe),
// and the null terminator isn't needed
for( int i=0; p[i] && i<*length; ++i ) {
_value[i] = p[i];
}
return p + (*length);
}
else
{
// Not valid text.
return 0;
}
}
static void PutString( const TIXML_STRING& str, TIXML_STRING* out );
static bool StringEqual( const char* p,
const char* endTag,
bool ignoreCase,
TiXmlEncoding encoding );
static const char* errorString[ TIXML_ERROR_STRING_COUNT ];
TiXmlCursor location;
void* userData;
static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding );
static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding );
inline static int ToLower( int v, TiXmlEncoding encoding )
{
if ( encoding == TIXML_ENCODING_UTF8 )
{
if ( v < 128 ) return tolower( v );
return v;
}
else
{
return tolower( v );
}
}
static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );
private:
TiXmlBase( const TiXmlBase& ); // not implemented.
void operator=( const TiXmlBase& base ); // not allowed.
#ifndef SKIP_DOCS
struct Entity
{
const char* str;
unsigned int strLength;
char chr;
};
#endif
enum
{
NUM_ENTITY = 5,
MAX_ENTITY_LENGTH = 6
};
static Entity entity[ NUM_ENTITY ];
static bool condenseWhiteSpace;
};
class EDELIB_API TiXmlNode : public TiXmlBase
{
friend class TiXmlDocument;
friend class TiXmlElement;
public:
#ifdef TIXML_USE_STL
friend std::istream& operator >> (std::istream& in, TiXmlNode& base);
friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base);
friend std::string& operator<< (std::string& out, const TiXmlNode& base );
#endif
enum NodeType
{
DOCUMENT,
ELEMENT,
COMMENT,
UNKNOWN,
TEXT,
DECLARATION,
TYPECOUNT
};
virtual ~TiXmlNode();
const char *Value() const { return value.c_str (); }
#ifdef TIXML_USE_STL
const std::string& ValueStr() const { return value; }
#endif
void SetValue(const char * _value) { value = _value;}
#ifdef TIXML_USE_STL
void SetValue( const std::string& _value ) { value = _value; }
#endif
void Clear();
TiXmlNode* Parent() { return parent; }
const TiXmlNode* Parent() const { return parent; }
const TiXmlNode* FirstChild() const { return firstChild; }
TiXmlNode* FirstChild() { return firstChild; }
const TiXmlNode* FirstChild( const char * value ) const;
TiXmlNode* FirstChild( const char * _value ) {
// Call through to the const version - safe since nothing is changed.
// Exiting syntax: cast this to a const (always safe)
// call the method, cast the return back to non-const.
return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value ));
}
const TiXmlNode* LastChild() const { return lastChild; }
TiXmlNode* LastChild() { return lastChild; }
const TiXmlNode* LastChild( const char * value ) const;
TiXmlNode* LastChild( const char * _value ) {
return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value ));
}
#ifdef TIXML_USE_STL
const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); }
TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); }
const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); }
TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); }
#endif
const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const;
TiXmlNode* IterateChildren( const TiXmlNode* previous ) {
return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) );
}
const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const;
TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) {
return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) );
}
#ifdef TIXML_USE_STL
const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const {
return IterateChildren (_value.c_str (), previous);
}
TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) {
return IterateChildren (_value.c_str (), previous);
}
#endif
TiXmlNode* InsertEndChild( const TiXmlNode& addThis );
TiXmlNode* LinkEndChild( TiXmlNode* addThis );
TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis );
TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis );
TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis );
bool RemoveChild( TiXmlNode* removeThis );
const TiXmlNode* PreviousSibling() const { return prev; }
TiXmlNode* PreviousSibling() { return prev; }
const TiXmlNode* PreviousSibling( const char * ) const;
TiXmlNode* PreviousSibling( const char *_prev ) {
return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) );
}
#ifdef TIXML_USE_STL
const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); }
TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); }
const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); }
TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); }
#endif
const TiXmlNode* NextSibling() const { return next; }
TiXmlNode* NextSibling() { return next; }
const TiXmlNode* NextSibling( const char * ) const;
TiXmlNode* NextSibling( const char* _next ) {
return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) );
}
const TiXmlElement* NextSiblingElement() const;
TiXmlElement* NextSiblingElement() {
return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() );
}
const TiXmlElement* NextSiblingElement( const char * ) const;
TiXmlElement* NextSiblingElement( const char *_next ) {
return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) );
}
#ifdef TIXML_USE_STL
const TiXmlElement* NextSiblingElement( const std::string& _value) const {
return NextSiblingElement (_value.c_str ());
}
TiXmlElement* NextSiblingElement( const std::string& _value) {
return NextSiblingElement (_value.c_str ());
}
#endif
const TiXmlElement* FirstChildElement() const;
TiXmlElement* FirstChildElement() {
return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() );
}
const TiXmlElement* FirstChildElement( const char * _value ) const;
TiXmlElement* FirstChildElement( const char * _value ) {
return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) );
}
#ifdef TIXML_USE_STL
const TiXmlElement* FirstChildElement( const std::string& _value ) const {
return FirstChildElement (_value.c_str ());
}
TiXmlElement* FirstChildElement( const std::string& _value ) {
return FirstChildElement (_value.c_str ());
}
#endif
int Type() const { return type; }
const TiXmlDocument* GetDocument() const;
TiXmlDocument* GetDocument() {
return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() );
}
bool NoChildren() const { return !firstChild; }
virtual const TiXmlDocument* ToDocument() const { return 0; }
virtual const TiXmlElement* ToElement() const { return 0; }
virtual const TiXmlComment* ToComment() const { return 0; }
virtual const TiXmlUnknown* ToUnknown() const { return 0; }
virtual const TiXmlText* ToText() const { return 0; }
virtual const TiXmlDeclaration* ToDeclaration() const { return 0; }
virtual TiXmlDocument* ToDocument() { return 0; }
virtual TiXmlElement* ToElement() { return 0; }
virtual TiXmlComment* ToComment() { return 0; }
virtual TiXmlUnknown* ToUnknown() { return 0; }
virtual TiXmlText* ToText() { return 0; }
virtual TiXmlDeclaration* ToDeclaration() { return 0; }
virtual TiXmlNode* Clone() const = 0;
virtual bool Accept( TiXmlVisitor* visitor ) const = 0;
protected:
TiXmlNode( NodeType _type );
void CopyTo( TiXmlNode* target ) const;
#ifdef TIXML_USE_STL
virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0;
#endif
TiXmlNode* Identify( const char* start, TiXmlEncoding encoding );
#ifndef SKIP_DOCS
TiXmlNode* parent;
NodeType type;
TiXmlNode* firstChild;
TiXmlNode* lastChild;
TIXML_STRING value;
TiXmlNode* prev;
TiXmlNode* next;
#endif
private:
TiXmlNode( const TiXmlNode& ); // not implemented.
void operator=( const TiXmlNode& base ); // not allowed.
};
class EDELIB_API TiXmlAttribute : public TiXmlBase
{
friend class TiXmlAttributeSet;
public:
TiXmlAttribute() : TiXmlBase()
{
document = 0;
prev = next = 0;
}
#ifdef TIXML_USE_STL
TiXmlAttribute( const std::string& _name, const std::string& _value )
{
name = _name;
value = _value;
document = 0;
prev = next = 0;
}
#endif
TiXmlAttribute( const char * _name, const char * _value )
{
name = _name;
value = _value;
document = 0;
prev = next = 0;
}
const char* Name() const { return name.c_str(); }
const char* Value() const { return value.c_str(); }
#ifdef TIXML_USE_STL
const std::string& ValueStr() const { return value; }
#endif
int IntValue() const;
double DoubleValue() const;
const TIXML_STRING& NameTStr() const { return name; }
int QueryIntValue( int* _value ) const;
int QueryDoubleValue( double* _value ) const;
void SetName( const char* _name ) { name = _name; }
void SetValue( const char* _value ) { value = _value; }
void SetIntValue( int _value );
void SetDoubleValue( double _value );
#ifdef TIXML_USE_STL
void SetName( const std::string& _name ) { name = _name; }
void SetValue( const std::string& _value ) { value = _value; }
#endif
const TiXmlAttribute* Next() const;
TiXmlAttribute* Next() {
return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() );
}
const TiXmlAttribute* Previous() const;
TiXmlAttribute* Previous() {
return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() );
}
bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; }
bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; }
bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; }
virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
virtual void Print( FILE* cfile, int depth ) const {
Print( cfile, depth, 0 );
}
void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
#ifndef SKIP_DOCS
// [internal use]
// Set the document pointer so the attribute can report errors.
void SetDocument( TiXmlDocument* doc ) { document = doc; }
#endif
private:
TiXmlAttribute( const TiXmlAttribute& ); // not implemented.
void operator=( const TiXmlAttribute& base ); // not allowed.
TiXmlDocument* document; // A pointer back to a document, for error reporting.
TIXML_STRING name;
TIXML_STRING value;
TiXmlAttribute* prev;
TiXmlAttribute* next;
};
#ifndef SKIP_DOCS
class TiXmlAttributeSet
{
public:
TiXmlAttributeSet();
~TiXmlAttributeSet();
void Add( TiXmlAttribute* attribute );
void Remove( TiXmlAttribute* attribute );
const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
const TiXmlAttribute* Find( const char* _name ) const;
TiXmlAttribute* Find( const char* _name ) {
return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
}
#ifdef TIXML_USE_STL
const TiXmlAttribute* Find( const std::string& _name ) const;
TiXmlAttribute* Find( const std::string& _name ) {
return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
}
#endif
private:
//*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element),
//*ME: this class must be also use a hidden/disabled copy-constructor !!!
TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed
void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute)
TiXmlAttribute sentinel;
};
#endif // SKIP_DOCS
class EDELIB_API TiXmlElement : public TiXmlNode
{
public:
TiXmlElement (const char * in_value);
#ifdef TIXML_USE_STL
TiXmlElement( const std::string& _value );
#endif
TiXmlElement( const TiXmlElement& );
void operator=( const TiXmlElement& base );
virtual ~TiXmlElement();
const char* Attribute( const char* name ) const;
const char* Attribute( const char* name, int* i ) const;
const char* Attribute( const char* name, double* d ) const;
int QueryIntAttribute( const char* name, int* _value ) const;
int QueryDoubleAttribute( const char* name, double* _value ) const;
int QueryFloatAttribute( const char* name, float* _value ) const {
double d;
int result = QueryDoubleAttribute( name, &d );
if ( result == TIXML_SUCCESS ) {
*_value = (float)d;
}
return result;
}
#ifdef TIXML_USE_STL
template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const
{
const TiXmlAttribute* node = attributeSet.Find( name );
if ( !node )
return TIXML_NO_ATTRIBUTE;
std::stringstream sstream( node->ValueStr() );
sstream >> *outValue;
if ( !sstream.fail() )
return TIXML_SUCCESS;
return TIXML_WRONG_TYPE;
}
#endif
void SetAttribute( const char* name, const char * _value );
#ifdef TIXML_USE_STL
const std::string* Attribute( const std::string& name ) const;
const std::string* Attribute( const std::string& name, int* i ) const;
const std::string* Attribute( const std::string& name, double* d ) const;
int QueryIntAttribute( const std::string& name, int* _value ) const;
int QueryDoubleAttribute( const std::string& name, double* _value ) const;
void SetAttribute( const std::string& name, const std::string& _value );
void SetAttribute( const std::string& name, int _value );
#endif
void SetAttribute( const char * name, int value );
void SetDoubleAttribute( const char * name, double value );
void RemoveAttribute( const char * name );
#ifdef TIXML_USE_STL
void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); }
#endif
const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); }
TiXmlAttribute* FirstAttribute() { return attributeSet.First(); }
const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); }
TiXmlAttribute* LastAttribute() { return attributeSet.Last(); }
const char* GetText() const;
virtual TiXmlNode* Clone() const;
virtual void Print( FILE* cfile, int depth ) const;
virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
virtual const TiXmlElement* ToElement() const { return this; }
virtual TiXmlElement* ToElement() { return this; }
virtual bool Accept( TiXmlVisitor* visitor ) const;
protected:
#ifndef SKIP_DOCS
void CopyTo( TiXmlElement* target ) const;
void ClearThis(); // like clear, but initializes 'this' object as well
// Used to be public [internal use]
#ifdef TIXML_USE_STL
virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
#endif
const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding );
#endif
private:
TiXmlAttributeSet attributeSet;
};
class EDELIB_API TiXmlComment : public TiXmlNode
{
public:
TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {}
TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) {
SetValue( _value );
}
TiXmlComment( const TiXmlComment& );
void operator=( const TiXmlComment& base );
virtual ~TiXmlComment() {}
virtual TiXmlNode* Clone() const;
virtual void Print( FILE* cfile, int depth ) const;
virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
virtual const TiXmlComment* ToComment() const { return this; }
virtual TiXmlComment* ToComment() { return this; }
virtual bool Accept( TiXmlVisitor* visitor ) const;
protected:
#ifndef SKIP_DOCS
void CopyTo( TiXmlComment* target ) const;
// used to be public
#ifdef TIXML_USE_STL
virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
#endif
// virtual void StreamOut( TIXML_OSTREAM * out ) const;
#endif
};
class EDELIB_API TiXmlText : public TiXmlNode
{
friend class TiXmlElement;
public:
TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT)
{
SetValue( initValue );
cdata = false;
}
virtual ~TiXmlText() {}
#ifdef TIXML_USE_STL
TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT)
{
SetValue( initValue );
cdata = false;
}
#endif
TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo( this ); }
void operator=( const TiXmlText& base ) { base.CopyTo( this ); }
virtual void Print( FILE* cfile, int depth ) const;
bool CDATA() const { return cdata; }
void SetCDATA( bool _cdata ) { cdata = _cdata; }
#ifndef SKIP_DOCS
virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
#endif
virtual const TiXmlText* ToText() const { return this; }
virtual TiXmlText* ToText() { return this; }
virtual bool Accept( TiXmlVisitor* content ) const;
protected :
#ifndef SKIP_DOCS
virtual TiXmlNode* Clone() const;
void CopyTo( TiXmlText* target ) const;
bool Blank() const; // returns true if all white space and new lines
// [internal use]
#ifdef TIXML_USE_STL
virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
#endif
#endif
private:
bool cdata; // true if this should be input and output as a CDATA style text element
};
class EDELIB_API TiXmlDeclaration : public TiXmlNode
{
public:
TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {}
#ifdef TIXML_USE_STL
TiXmlDeclaration( const std::string& _version,
const std::string& _encoding,
const std::string& _standalone );
#endif
TiXmlDeclaration( const char* _version,
const char* _encoding,
const char* _standalone );
TiXmlDeclaration( const TiXmlDeclaration& copy );
void operator=( const TiXmlDeclaration& copy );
#ifndef SKIP_DOCS
virtual ~TiXmlDeclaration() {}
#endif
const char *Version() const { return version.c_str (); }
const char *Encoding() const { return encoding.c_str (); }
const char *Standalone() const { return standalone.c_str (); }
virtual TiXmlNode* Clone() const;
virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
virtual void Print( FILE* cfile, int depth ) const {
Print( cfile, depth, 0 );
}
#ifndef SKIP_DOCS
virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
#endif
virtual const TiXmlDeclaration* ToDeclaration() const { return this; }
virtual TiXmlDeclaration* ToDeclaration() { return this; }
virtual bool Accept( TiXmlVisitor* visitor ) const;
protected:
#ifndef SKIP_DOCS
void CopyTo( TiXmlDeclaration* target ) const;
// used to be public
#ifdef TIXML_USE_STL
virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
#endif
#endif
private:
TIXML_STRING version;
TIXML_STRING encoding;
TIXML_STRING standalone;
};
class TiXmlUnknown : public TiXmlNode
{
public:
TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN ) {}
#ifndef SKIP_DOCS
virtual ~TiXmlUnknown() {}
#endif
TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN ) { copy.CopyTo( this ); }
void operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); }
virtual TiXmlNode* Clone() const;
virtual void Print( FILE* cfile, int depth ) const;
#ifndef SKIP_DOCS
virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
#endif
virtual const TiXmlUnknown* ToUnknown() const { return this; }
virtual TiXmlUnknown* ToUnknown() { return this; }
virtual bool Accept( TiXmlVisitor* content ) const;
protected:
#ifndef SKIP_DOCS
void CopyTo( TiXmlUnknown* target ) const;
#ifdef TIXML_USE_STL
virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
#endif
#endif
private:
};
class EDELIB_API TiXmlDocument : public TiXmlNode
{
public:
TiXmlDocument();
TiXmlDocument( const char * documentName );
#ifdef TIXML_USE_STL
TiXmlDocument( const std::string& documentName );
#endif
TiXmlDocument( const TiXmlDocument& copy );
void operator=( const TiXmlDocument& copy );
#ifndef SKIP_DOCS
virtual ~TiXmlDocument() {}
#endif
bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
bool SaveFile() const;
bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
bool SaveFile( const char * filename ) const;
bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
bool SaveFile( FILE* ) const;
#ifdef TIXML_USE_STL
bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING )
{
return LoadFile( filename.c_str(), encoding );
}
bool SaveFile( const std::string& filename ) const
{
return SaveFile( filename.c_str() );
}
#endif
virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
const TiXmlElement* RootElement() const { return FirstChildElement(); }
TiXmlElement* RootElement() { return FirstChildElement(); }
bool Error() const { return error; }
const char * ErrorDesc() const { return errorDesc.c_str (); }
int ErrorId() const { return errorId; }
int ErrorRow() const { return errorLocation.row+1; }
int ErrorCol() const { return errorLocation.col+1; }
void SetTabSize( int _tabsize ) { tabsize = _tabsize; }
int TabSize() const { return tabsize; }
void ClearError() { error = false;
errorId = 0;
errorDesc = "";
errorLocation.row = errorLocation.col = 0;
//errorLocation.last = 0;
}
void Print() const { Print( stdout, 0 ); }
//char* PrintToMemory() const;
virtual void Print( FILE* cfile, int depth = 0 ) const;
#ifndef SKIP_DOCS
// [internal use]
void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding );
#endif
virtual const TiXmlDocument* ToDocument() const { return this; }
virtual TiXmlDocument* ToDocument() { return this; }
virtual bool Accept( TiXmlVisitor* content ) const;
protected :
#ifndef SKIP_DOCS
// [internal use]
virtual TiXmlNode* Clone() const;
#ifdef TIXML_USE_STL
virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
#endif
#endif
private:
void CopyTo( TiXmlDocument* target ) const;
bool error;
int errorId;
TIXML_STRING errorDesc;
int tabsize;
TiXmlCursor errorLocation;
bool useMicrosoftBOM; // the UTF-8 BOM were found when read. Note this, and try to write.
};
class EDELIB_API TiXmlHandle
{
public:
TiXmlHandle( TiXmlNode* _node ) { this->node = _node; }
TiXmlHandle( const TiXmlHandle& ref ) { this->node = ref.node; }
TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; }
TiXmlHandle FirstChild() const;
TiXmlHandle FirstChild( const char * value ) const;
TiXmlHandle FirstChildElement() const;
TiXmlHandle FirstChildElement( const char * value ) const;
TiXmlHandle Child( const char* value, int index ) const;
TiXmlHandle Child( int index ) const;
TiXmlHandle ChildElement( const char* value, int index ) const;
TiXmlHandle ChildElement( int index ) const;
#ifdef TIXML_USE_STL
TiXmlHandle FirstChild( const std::string& _value ) const { return FirstChild( _value.c_str() ); }
TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); }
TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); }
TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); }
#endif
TiXmlNode* ToNode() const { return node; }
TiXmlElement* ToElement() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); }
TiXmlText* ToText() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); }
TiXmlUnknown* ToUnknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); }
TiXmlNode* Node() const { return ToNode(); }
TiXmlElement* Element() const { return ToElement(); }
TiXmlText* Text() const { return ToText(); }
TiXmlUnknown* Unknown() const { return ToUnknown(); }
private:
TiXmlNode* node;
};
class TiXmlPrinter : public TiXmlVisitor
{
public:
TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ),
buffer(), indent( " " ), lineBreak( "\n" ) {}
#ifndef SKIP_DOCS
virtual bool VisitEnter( const TiXmlDocument& doc );
virtual bool VisitExit( const TiXmlDocument& doc );
virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute );
virtual bool VisitExit( const TiXmlElement& element );
virtual bool Visit( const TiXmlDeclaration& declaration );
virtual bool Visit( const TiXmlText& text );
virtual bool Visit( const TiXmlComment& comment );
virtual bool Visit( const TiXmlUnknown& unknown );
#endif
void SetIndent( const char* _indent ) { indent = _indent ? _indent : "" ; }
const char* Indent() { return indent.c_str(); }
void SetLineBreak( const char* _lineBreak ) { lineBreak = _lineBreak ? _lineBreak : ""; }
const char* LineBreak() { return lineBreak.c_str(); }
void SetStreamPrinting() { indent = ""; lineBreak = ""; }
const char* CStr() { return buffer.c_str(); }
size_t Size() { return buffer.length(); }
#ifdef TIXML_USE_STL
const std::string& Str() { return buffer; }
#endif
private:
void DoIndent() {
for( int i=0; i<depth; ++i )
buffer += indent;
}
void DoLineBreak() {
buffer += lineBreak;
}
int depth;
bool simpleTextPrint;
TIXML_STRING buffer;
TIXML_STRING indent;
TIXML_STRING lineBreak;
};
#ifdef _MSC_VER
#pragma warning( pop )
#endif
#endif
TiXmlHandle::operator=
TiXmlHandle operator=(const TiXmlHandle &ref)
Definition: TiXml.h:1874
TiXmlHandle::Element
TiXmlElement * Element() const
Definition: TiXml.h:1938
TiXmlBase::location
TiXmlCursor location
Definition: TiXml.h:390
TiXmlBase::ReadName
static const char * ReadName(const char *p, edelib::String *name, TiXmlEncoding encoding)
TiXmlNode::GetDocument
const TiXmlDocument * GetDocument() const
TiXmlUnknown::TiXmlUnknown
TiXmlUnknown()
Definition: TiXml.h:1542
TiXmlAttribute
Name-value pair.
Definition: TiXml.h:903
TiXmlText::TiXmlText
TiXmlText(const TiXmlText &copy)
Definition: TiXml.h:1396
TiXmlVisitor::VisitEnter
virtual bool VisitEnter(const TiXmlElement &element, const TiXmlAttribute *firstAttribute)
Definition: TiXml.h:134
TiXmlNode::LinkEndChild
TiXmlNode * LinkEndChild(TiXmlNode *addThis)
TiXmlVisitor
SAX emulation.
Definition: TiXml.h:123
TiXmlNode::Clear
void Clear()
TiXmlVisitor::~TiXmlVisitor
virtual ~TiXmlVisitor()
Definition: TiXml.h:127
TiXmlNode::InsertBeforeChild
TiXmlNode * InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)
TiXmlPrinter::SetIndent
void SetIndent(const char *_indent)
Definition: TiXml.h:2001
TiXmlHandle::Unknown
TiXmlUnknown * Unknown() const
Definition: TiXml.h:1948
TiXmlAttribute::NameTStr
const edelib::String & NameTStr() const
Definition: TiXml.h:949
TiXmlDocument::Error
bool Error() const
Definition: TiXml.h:1670
TiXmlNode::Parent
const TiXmlNode * Parent() const
Definition: TiXml.h:551
TiXmlDeclaration::Encoding
const char * Encoding() const
Definition: TiXml.h:1485
TiXmlNode::SetValue
void SetValue(const char *_value)
Definition: TiXml.h:538
TiXmlText::TiXmlText
TiXmlText(const char *initValue)
Definition: TiXml.h:1380
TiXmlAttribute::TiXmlAttribute
TiXmlAttribute()
Definition: TiXml.h:909
TiXmlElement::Parse
virtual const char * Parse(const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)
TiXmlHandle::TiXmlHandle
TiXmlHandle(TiXmlNode *_node)
Definition: TiXml.h:1870
TiXmlDocument::ErrorDesc
const char * ErrorDesc() const
Definition: TiXml.h:1673
TiXmlDocument::ClearError
void ClearError()
Definition: TiXml.h:1728
TiXmlDocument::RootElement
TiXmlElement * RootElement()
Definition: TiXml.h:1662
TiXmlNode::ToDeclaration
virtual TiXmlDeclaration * ToDeclaration()
Definition: TiXml.h:823
TiXmlNode::Type
int Type() const
Definition: TiXml.h:784
TiXmlPrinter::SetStreamPrinting
void SetStreamPrinting()
Definition: TiXml.h:2019
TiXmlPrinter::LineBreak
const char * LineBreak()
Definition: TiXml.h:2013
TiXmlNode::TiXmlNode
TiXmlNode(NodeType _type)
TiXmlNode::ReplaceChild
TiXmlNode * ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis)
TiXmlNode::InsertAfterChild
TiXmlNode * InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis)
TiXmlText::operator=
void operator=(const TiXmlText &base)
Definition: TiXml.h:1398
TiXmlText::SetCDATA
void SetCDATA(bool _cdata)
Definition: TiXml.h:1406
TiXmlPrinter::Size
size_t Size()
Definition: TiXml.h:2023
TiXmlNode::GetDocument
TiXmlDocument * GetDocument()
Definition: TiXml.h:793
TiXmlNode::IterateChildren
TiXmlNode * IterateChildren(const char *_value, const TiXmlNode *previous)
Definition: TiXml.h:620
TiXmlBase::GetEntity
static const char * GetEntity(const char *in, char *value, int *length, TiXmlEncoding encoding)
TiXmlNode::ToUnknown
virtual const TiXmlUnknown * ToUnknown() const
Definition: TiXml.h:806
TiXmlVisitor::VisitExit
virtual bool VisitExit(const TiXmlDocument &doc)
Definition: TiXml.h:132
TiXmlNode::ToDeclaration
virtual const TiXmlDeclaration * ToDeclaration() const
Definition: TiXml.h:810
TiXmlAttribute::SetName
void SetName(const char *_name)
Definition: TiXml.h:966
TiXmlElement::Print
virtual void Print(FILE *cfile, int depth) const
TiXmlElement::Accept
virtual bool Accept(TiXmlVisitor *visitor) const
TiXmlText::ToText
virtual TiXmlText * ToText()
Definition: TiXml.h:1414
TiXmlBase::SetUserData
void SetUserData(void *user)
Definition: TiXml.h:250
TiXmlDocument::ErrorId
int ErrorId() const
Definition: TiXml.h:1679
TiXmlElement::ToElement
virtual const TiXmlElement * ToElement() const
Definition: TiXml.h:1278
TiXmlBase::PutString
static void PutString(const edelib::String &str, edelib::String *out)
TiXmlAttribute::Name
const char * Name() const
Definition: TiXml.h:936
TiXmlDocument::Parse
virtual const char * Parse(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
TiXmlNode::NextSibling
TiXmlNode * NextSibling(const char *_next)
Definition: TiXml.h:713
TiXmlBase::Row
int Row() const
Definition: TiXml.h:246
TiXmlElement::LastAttribute
TiXmlAttribute * LastAttribute()
Definition: TiXml.h:1229
TiXmlDocument::TabSize
int TabSize() const
Definition: TiXml.h:1722
TiXmlHandle::Text
TiXmlText * Text() const
Definition: TiXml.h:1943
TiXmlAttribute::SetValue
void SetValue(const char *_value)
Definition: TiXml.h:968
TiXmlNode::NextSibling
const TiXmlNode * NextSibling() const
Definition: TiXml.h:706
TiXmlVisitor::VisitEnter
virtual bool VisitEnter(const TiXmlDocument &doc)
Definition: TiXml.h:130
TiXmlPrinter::CStr
const char * CStr()
Definition: TiXml.h:2021
TiXmlDocument::SetTabSize
void SetTabSize(int _tabsize)
Definition: TiXml.h:1719
TiXmlNode::NextSiblingElement
const TiXmlElement * NextSiblingElement() const
TiXmlElement::FirstAttribute
const TiXmlAttribute * FirstAttribute() const
Definition: TiXml.h:1222
TiXmlNode::PreviousSibling
TiXmlNode * PreviousSibling(const char *_prev)
Definition: TiXml.h:690
TiXmlNode::NodeType
NodeType
Definition: TiXml.h:492
TiXmlNode::ToDocument
virtual const TiXmlDocument * ToDocument() const
Definition: TiXml.h:800
TiXmlBase::Column
int Column() const
Definition: TiXml.h:248
TiXmlAttribute::Previous
TiXmlAttribute * Previous()
Definition: TiXml.h:992
TiXmlBase::ConvertUTF32ToUTF8
static void ConvertUTF32ToUTF8(unsigned long input, char *output, int *length)
TiXmlNode::IterateChildren
const TiXmlNode * IterateChildren(const TiXmlNode *previous) const
TiXmlDeclaration
XML declaration.
Definition: TiXml.h:1455
TiXmlUnknown
Unknown XML element.
Definition: TiXml.h:1538
TiXmlDocument::ErrorCol
int ErrorCol() const
Definition: TiXml.h:1692
TiXmlVisitor::Visit
virtual bool Visit(const TiXmlComment &comment)
Definition: TiXml.h:142
TiXmlNode::ToElement
virtual TiXmlElement * ToElement()
Definition: TiXml.h:815
TiXmlBase::GetChar
static const char * GetChar(const char *p, char *_value, int *length, TiXmlEncoding encoding)
Definition: TiXml.h:334
TiXmlPrinter::Indent
const char * Indent()
Definition: TiXml.h:2003
TiXmlNode::FirstChild
TiXmlNode * FirstChild()
Definition: TiXml.h:556
TiXmlUnknown::ToUnknown
virtual const TiXmlUnknown * ToUnknown() const
Definition: TiXml.h:1560
TiXmlDocument::ErrorRow
int ErrorRow() const
Definition: TiXml.h:1689
TiXmlElement::LastAttribute
const TiXmlAttribute * LastAttribute() const
Definition: TiXml.h:1227
TiXmlNode::FirstChildElement
const TiXmlElement * FirstChildElement() const
TiXmlNode::ToDocument
virtual TiXmlDocument * ToDocument()
Definition: TiXml.h:813
TiXmlBase::StringEqual
static bool StringEqual(const char *p, const char *endTag, bool ignoreCase, TiXmlEncoding encoding)
TiXmlNode::PreviousSibling
TiXmlNode * PreviousSibling()
Definition: TiXml.h:685
TiXmlComment::TiXmlComment
TiXmlComment()
Definition: TiXml.h:1316
TiXmlNode::Parent
TiXmlNode * Parent()
Definition: TiXml.h:549
TiXmlPrinter::TiXmlPrinter
TiXmlPrinter()
Definition: TiXml.h:1982
TiXmlNode::InsertEndChild
TiXmlNode * InsertEndChild(const TiXmlNode &addThis)
TiXmlComment::~TiXmlComment
virtual ~TiXmlComment()
Definition: TiXml.h:1327
TiXmlElement::ToElement
virtual TiXmlElement * ToElement()
Definition: TiXml.h:1280
TiXmlDocument
Top level node.
Definition: TiXml.h:1590
TiXmlUnknown::TiXmlUnknown
TiXmlUnknown(const TiXmlUnknown &copy)
Definition: TiXml.h:1548
TiXmlHandle::TiXmlHandle
TiXmlHandle(const TiXmlHandle &ref)
Definition: TiXml.h:1872
TiXmlDocument::Print
void Print() const
Definition: TiXml.h:1736
TiXmlNode::ToText
virtual const TiXmlText * ToText() const
Definition: TiXml.h:808
TiXmlComment::ToComment
virtual const TiXmlComment * ToComment() const
Definition: TiXml.h:1341
TiXmlAttribute::Value
const char * Value() const
Definition: TiXml.h:938
TiXmlNode::CopyTo
void CopyTo(TiXmlNode *target) const
TiXmlAttribute::TiXmlAttribute
TiXmlAttribute(const char *_name, const char *_value)
Definition: TiXml.h:927
TiXmlNode::ToComment
virtual const TiXmlComment * ToComment() const
Definition: TiXml.h:804
TiXmlHandle::ToNode
TiXmlNode * ToNode() const
Definition: TiXml.h:1921
TiXmlHandle
Wraps a node pointer.
Definition: TiXml.h:1866
TiXmlNode::LastChild
TiXmlNode * LastChild()
Definition: TiXml.h:572
TiXmlBase::IsWhiteSpaceCondensed
static bool IsWhiteSpaceCondensed()
Definition: TiXml.h:226
TiXmlDeclaration::Version
const char * Version() const
Definition: TiXml.h:1483
TiXmlElement::FirstAttribute
TiXmlAttribute * FirstAttribute()
Definition: TiXml.h:1224
TiXmlNode::ToUnknown
virtual TiXmlUnknown * ToUnknown()
Definition: TiXml.h:819
TiXmlNode::Value
const char * Value() const
Definition: TiXml.h:517
TiXmlAttribute::Next
TiXmlAttribute * Next()
Definition: TiXml.h:985
TiXmlNode::Identify
TiXmlNode * Identify(const char *start, TiXmlEncoding encoding)
TiXmlNode::FirstChild
TiXmlNode * FirstChild(const char *_value)
Definition: TiXml.h:561
TiXmlHandle::ToText
TiXmlText * ToText() const
Definition: TiXml.h:1925
TiXmlBase::userData
void * userData
Definition: TiXml.h:393
TiXmlNode::PreviousSibling
const TiXmlNode * PreviousSibling() const
Definition: TiXml.h:680
TiXmlElement::QueryFloatAttribute
int QueryFloatAttribute(const char *name, float *_value) const
Definition: TiXml.h:1148
TiXmlBase
Xml base class.
Definition: TiXml.h:194
TiXmlBase::IsAlpha
static int IsAlpha(unsigned char anyByte, TiXmlEncoding encoding)
TiXmlHandle::ToUnknown
TiXmlUnknown * ToUnknown() const
Definition: TiXml.h:1927
TiXmlDocument::RootElement
const TiXmlElement * RootElement() const
Definition: TiXml.h:1660
TiXmlVisitor::VisitExit
virtual bool VisitExit(const TiXmlElement &element)
Definition: TiXml.h:136
TiXmlAttribute::operator<
bool operator<(const TiXmlAttribute &rhs) const
Definition: TiXml.h:999
TiXmlDocument::ToDocument
virtual TiXmlDocument * ToDocument()
Definition: TiXml.h:1754
TiXmlHandle::ToElement
TiXmlElement * ToElement() const
Definition: TiXml.h:1923
TiXmlNode::LastChild
TiXmlNode * LastChild(const char *_value)
Definition: TiXml.h:578
TiXmlElement::operator=
void operator=(const TiXmlElement &base)
TiXmlNode::IterateChildren
TiXmlNode * IterateChildren(const TiXmlNode *previous)
Definition: TiXml.h:613
TiXmlBase::errorString
static const char * errorString[TIXML_ERROR_STRING_COUNT]
Definition: TiXml.h:387
TiXmlNode
Parent class for everything in DOM.
Definition: TiXml.h:450
TiXmlVisitor::Visit
virtual bool Visit(const TiXmlUnknown &unknown)
Definition: TiXml.h:144
TiXmlDeclaration::ToDeclaration
virtual const TiXmlDeclaration * ToDeclaration() const
Definition: TiXml.h:1502
TiXmlBase::ReadText
static const char * ReadText(const char *in, edelib::String *text, bool ignoreWhiteSpace, const char *endTag, bool ignoreCase, TiXmlEncoding encoding)
TiXmlPrinter
Print to memory.
Definition: TiXml.h:1978
TiXmlHandle::Node
TiXmlNode * Node() const
Definition: TiXml.h:1933
TiXmlText
XML text.
Definition: TiXml.h:1371
TiXmlElement::Clone
virtual TiXmlNode * Clone() const
TiXmlNode::FirstChildElement
TiXmlElement * FirstChildElement(const char *_value)
Definition: TiXml.h:763
TiXmlNode::ToElement
virtual const TiXmlElement * ToElement() const
Definition: TiXml.h:802
TiXmlDocument::ToDocument
virtual const TiXmlDocument * ToDocument() const
Definition: TiXml.h:1752
TiXmlVisitor::Visit
virtual bool Visit(const TiXmlText &text)
Definition: TiXml.h:140
TiXmlText::CDATA
bool CDATA() const
Definition: TiXml.h:1404
TiXmlVisitor::Visit
virtual bool Visit(const TiXmlDeclaration &declaration)
Definition: TiXml.h:138
TiXmlAttribute::operator>
bool operator>(const TiXmlAttribute &rhs) const
Definition: TiXml.h:1001
TiXmlPrinter::SetLineBreak
void SetLineBreak(const char *_lineBreak)
Definition: TiXml.h:2010
edelib::operator<<
EdbusList & operator<<(EdbusList &lst, const EdbusData &val)
Definition: EdbusList.h:219
TiXmlNode::NextSiblingElement
TiXmlElement * NextSiblingElement()
Definition: TiXml.h:726
TiXmlNode::NextSibling
TiXmlNode * NextSibling()
Definition: TiXml.h:708
TiXmlDeclaration::TiXmlDeclaration
TiXmlDeclaration()
Definition: TiXml.h:1459
TiXmlUnknown::ToUnknown
virtual TiXmlUnknown * ToUnknown()
Definition: TiXml.h:1562
TiXmlBase::GetUserData
const void * GetUserData() const
Definition: TiXml.h:254
TiXmlDocument::operator=
void operator=(const TiXmlDocument &copy)
TiXmlComment::ToComment
virtual TiXmlComment * ToComment()
Definition: TiXml.h:1343
TiXmlDeclaration::Standalone
const char * Standalone() const
Definition: TiXml.h:1487
TiXmlAttribute::Print
virtual void Print(FILE *cfile, int depth) const
Definition: TiXml.h:1010
TiXmlDeclaration::ToDeclaration
virtual TiXmlDeclaration * ToDeclaration()
Definition: TiXml.h:1504
TiXmlBase::GetUserData
void * GetUserData()
Definition: TiXml.h:252
TiXmlNode::NextSiblingElement
TiXmlElement * NextSiblingElement(const char *_next)
Definition: TiXml.h:739
TiXmlNode::ToText
virtual TiXmlText * ToText()
Definition: TiXml.h:821
TiXmlNode::LastChild
const TiXmlNode * LastChild() const
Definition: TiXml.h:569
TiXmlText::ToText
virtual const TiXmlText * ToText() const
Definition: TiXml.h:1412
TiXmlComment
A XML Comment.
Definition: TiXml.h:1312
TiXmlBase::SetCondenseWhiteSpace
static void SetCondenseWhiteSpace(bool condense)
Definition: TiXml.h:223
TiXmlNode::FirstChild
const TiXmlNode * FirstChild() const
Definition: TiXml.h:554
TiXmlAttribute::operator==
bool operator==(const TiXmlAttribute &rhs) const
Definition: TiXml.h:997
TiXmlBase::IsAlphaNum
static int IsAlphaNum(unsigned char anyByte, TiXmlEncoding encoding)
TiXmlUnknown::operator=
void operator=(const TiXmlUnknown &copy)
Definition: TiXml.h:1550
TiXmlNode::FirstChildElement
TiXmlElement * FirstChildElement()
Definition: TiXml.h:757
TiXmlComment::TiXmlComment
TiXmlComment(const char *_value)
Definition: TiXml.h:1318
TiXmlNode::NoChildren
bool NoChildren() const
Definition: TiXml.h:798
TiXmlBase::ToLower
static int ToLower(int v, TiXmlEncoding encoding)
Definition: TiXml.h:403
TiXmlElement
Container xml class.
Definition: TiXml.h:1092
TiXmlNode::ToComment
virtual TiXmlComment * ToComment()
Definition: TiXml.h:817
TiXmlNode::RemoveChild
bool RemoveChild(TiXmlNode *removeThis)
TiXmlDeclaration::Print
virtual void Print(FILE *cfile, int depth) const
Definition: TiXml.h:1495