 |
Newton Dynamics
4.00
|
|
26 #ifndef TINYXML_INCLUDED
27 #define TINYXML_INCLUDED
30 #pragma warning( push )
31 #pragma warning( disable : 4530 )
32 #pragma warning( disable : 4786 )
42 #if defined( _DEBUG ) && !defined( DEBUG )
50 #define TIXML_STRING std::string
53 #define TIXML_STRING TiXmlString
63 #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
65 #define TIXML_SNPRINTF _snprintf_s
66 #define TIXML_SNSCANF _snscanf_s
67 #define TIXML_SSCANF sscanf_s
68 #elif defined(_MSC_VER) && (_MSC_VER >= 1200 )
71 #define TIXML_SNPRINTF _snprintf
72 #define TIXML_SNSCANF _snscanf
73 #define TIXML_SSCANF sscanf
74 #elif defined(__GNUC__) && (__GNUC__ >= 3 )
77 #define TIXML_SNPRINTF snprintf
78 #define TIXML_SNSCANF snscanf
79 #define TIXML_SSCANF sscanf
81 #define TIXML_SSCANF sscanf
93 class TiXmlDeclaration;
94 class TiXmlParsingData;
96 const int TIXML_MAJOR_VERSION = 2;
97 const int TIXML_MINOR_VERSION = 5;
98 const int TIXML_PATCH_VERSION = 3;
106 void Clear() { row = col = -1; }
136 void *
operator new (
size_t size);
137 void *
operator new[](
size_t size);
138 void operator delete (
void* ptr);
139 void operator delete[](
void* ptr);
173 TIXML_ENCODING_UNKNOWN,
175 TIXML_ENCODING_LEGACY
178 const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN;
212 void *
operator new (
size_t size);
213 void *
operator new[](
size_t size);
214 void operator delete (
void* ptr);
215 void operator delete[](
void* ptr);
226 virtual void Print( FILE* cfile,
int depth )
const = 0;
257 int Row()
const {
return location.row + 1; }
258 int Column()
const {
return location.col + 1; }
266 static const int utf8ByteTable[256];
268 virtual const char* Parse(
const char* p,
270 TiXmlEncoding encoding ) = 0;
275 static void EncodeString(
const TIXML_STRING& str, TIXML_STRING* out );
281 TIXML_ERROR_OPENING_FILE,
282 TIXML_ERROR_OUT_OF_MEMORY,
283 TIXML_ERROR_PARSING_ELEMENT,
284 TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME,
285 TIXML_ERROR_READING_ELEMENT_VALUE,
286 TIXML_ERROR_READING_ATTRIBUTES,
287 TIXML_ERROR_PARSING_EMPTY,
288 TIXML_ERROR_READING_END_TAG,
289 TIXML_ERROR_PARSING_UNKNOWN,
290 TIXML_ERROR_PARSING_COMMENT,
291 TIXML_ERROR_PARSING_DECLARATION,
292 TIXML_ERROR_DOCUMENT_EMPTY,
293 TIXML_ERROR_EMBEDDED_NULL,
294 TIXML_ERROR_PARSING_CDATA,
295 TIXML_ERROR_DOCUMENT_TOP_ONLY,
297 TIXML_ERROR_STRING_COUNT
302 static const char* SkipWhiteSpace(
const char*, TiXmlEncoding encoding );
303 inline static bool IsWhiteSpace(
char c )
305 return ( isspace( (
unsigned char) c ) || c ==
'\n' || c ==
'\r' );
307 inline static bool IsWhiteSpace(
int c )
310 return IsWhiteSpace( (
char) c );
315 static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag );
316 static bool StreamTo( std::istream * in,
int character, TIXML_STRING * tag );
323 static const char* ReadName(
const char* p, TIXML_STRING* name, TiXmlEncoding encoding );
328 static const char* ReadText(
const char* in,
330 bool ignoreWhiteSpace,
333 TiXmlEncoding encoding );
336 static const char* GetEntity(
const char* in,
char* value,
int* length, TiXmlEncoding encoding );
340 inline static const char* GetChar(
const char* p,
char* _value,
int* length, TiXmlEncoding encoding )
343 if ( encoding == TIXML_ENCODING_UTF8 )
345 *length = utf8ByteTable[ *((
const unsigned char*)p) ];
346 assert( *length >= 0 && *length < 5 );
356 return GetEntity( p, _value, length, encoding );
364 for(
int i=0; p[i] && i<*length; ++i ) {
367 return p + (*length);
379 static bool StringEqual(
const char* p,
382 TiXmlEncoding encoding );
384 static const char* errorString[ TIXML_ERROR_STRING_COUNT ];
386 TiXmlCursor location;
393 static int IsAlpha(
unsigned char anyByte, TiXmlEncoding encoding );
394 static int IsAlphaNum(
unsigned char anyByte, TiXmlEncoding encoding );
395 inline static int ToLower(
int v, TiXmlEncoding encoding )
397 if ( encoding == TIXML_ENCODING_UTF8 )
399 if ( v < 128 )
return tolower( v );
407 static void ConvertUTF32ToUTF8(
unsigned long input,
char* output,
int* length );
410 TiXmlBase(
const TiXmlBase& );
411 void operator=(
const TiXmlBase& base );
416 unsigned int strLength;
422 MAX_ENTITY_LENGTH = 6
425 static Entity entity[ NUM_ENTITY ];
426 static bool condenseWhiteSpace;
447 friend std::istream& operator >> (std::istream& in,
TiXmlNode& base);
465 friend std::ostream& operator<< (std::ostream& out,
const TiXmlNode& base);
468 friend std::string& operator<< (std::string& out,
const TiXmlNode& base );
500 const char *
Value()
const {
return value.c_str (); }
507 const std::string& ValueStr()
const {
return value; }
510 const TIXML_STRING& ValueTStr()
const {
return value; }
521 void SetValue(
const char * _value) { value = _value;}
524 void SetValue(
const std::string& _value ) { value = _value; }
533 const TiXmlNode* Parent()
const {
return parent; }
536 TiXmlNode* FirstChild() {
return firstChild; }
537 const TiXmlNode* FirstChild(
const char * value )
const;
538 TiXmlNode* FirstChild(
const char * _value ) {
542 return const_cast< TiXmlNode*
> ((
const_cast< const TiXmlNode*
>(
this))->FirstChild( _value ));
544 const TiXmlNode* LastChild()
const {
return lastChild; }
547 const TiXmlNode* LastChild(
const char * value )
const;
549 return const_cast< TiXmlNode*
> ((
const_cast< const TiXmlNode*
>(
this))->LastChild( _value ));
553 const TiXmlNode* FirstChild(
const std::string& _value )
const {
return FirstChild (_value.c_str ()); }
554 TiXmlNode* FirstChild(
const std::string& _value ) {
return FirstChild (_value.c_str ()); }
555 const TiXmlNode* LastChild(
const std::string& _value )
const {
return LastChild (_value.c_str ()); }
556 TiXmlNode* LastChild(
const std::string& _value ) {
return LastChild (_value.c_str ()); }
575 const TiXmlNode* IterateChildren(
const TiXmlNode* previous )
const;
576 TiXmlNode* IterateChildren(
const TiXmlNode* previous ) {
577 return const_cast< TiXmlNode*
>( (
const_cast< const TiXmlNode*
>(
this))->IterateChildren( previous ) );
581 const TiXmlNode* IterateChildren(
const char * value,
const TiXmlNode* previous )
const;
582 TiXmlNode* IterateChildren(
const char * _value,
const TiXmlNode* previous ) {
583 return const_cast< TiXmlNode*
>( (
const_cast< const TiXmlNode*
>(
this))->IterateChildren( _value, previous ) );
587 const TiXmlNode* IterateChildren(
const std::string& _value,
const TiXmlNode* previous )
const {
return IterateChildren (_value.c_str (), previous); }
588 TiXmlNode* IterateChildren(
const std::string& _value,
const TiXmlNode* previous ) {
return IterateChildren (_value.c_str (), previous); }
594 TiXmlNode* InsertEndChild(
const TiXmlNode& addThis );
606 TiXmlNode* LinkEndChild( TiXmlNode* addThis );
611 TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis,
const TiXmlNode& addThis );
616 TiXmlNode* InsertAfterChild( TiXmlNode* afterThis,
const TiXmlNode& addThis );
621 TiXmlNode* ReplaceChild( TiXmlNode* replaceThis,
const TiXmlNode& withThis );
624 bool RemoveChild( TiXmlNode* removeThis );
628 TiXmlNode* PreviousSibling() {
return prev; }
631 const TiXmlNode* PreviousSibling(
const char * )
const;
632 TiXmlNode* PreviousSibling(
const char *_prev ) {
633 return const_cast< TiXmlNode*
>( (
const_cast< const TiXmlNode*
>(
this))->PreviousSibling( _prev ) );
637 const TiXmlNode* PreviousSibling(
const std::string& _value )
const {
return PreviousSibling (_value.c_str ()); }
638 TiXmlNode* PreviousSibling(
const std::string& _value ) {
return PreviousSibling (_value.c_str ()); }
639 const TiXmlNode* NextSibling(
const std::string& _value)
const {
return NextSibling (_value.c_str ()); }
640 TiXmlNode* NextSibling(
const std::string& _value) {
return NextSibling (_value.c_str ()); }
645 TiXmlNode* NextSibling() {
return next; }
648 const TiXmlNode* NextSibling(
const char * )
const;
649 TiXmlNode* NextSibling(
const char* _next ) {
650 return const_cast< TiXmlNode*
>( (
const_cast< const TiXmlNode*
>(
this))->NextSibling( _next ) );
657 const TiXmlElement* NextSiblingElement()
const;
658 TiXmlElement* NextSiblingElement() {
659 return const_cast< TiXmlElement*
>( (
const_cast< const TiXmlNode*
>(
this))->NextSiblingElement() );
666 const TiXmlElement* NextSiblingElement(
const char * )
const;
667 TiXmlElement* NextSiblingElement(
const char *_next ) {
668 return const_cast< TiXmlElement*
>( (
const_cast< const TiXmlNode*
>(
this))->NextSiblingElement( _next ) );
672 const TiXmlElement* NextSiblingElement(
const std::string& _value)
const {
return NextSiblingElement (_value.c_str ()); }
673 TiXmlElement* NextSiblingElement(
const std::string& _value) {
return NextSiblingElement (_value.c_str ()); }
677 const TiXmlElement* FirstChildElement()
const;
678 TiXmlElement* FirstChildElement() {
679 return const_cast< TiXmlElement*
>( (
const_cast< const TiXmlNode*
>(
this))->FirstChildElement() );
683 const TiXmlElement* FirstChildElement(
const char * _value )
const;
684 TiXmlElement* FirstChildElement(
const char * _value ) {
685 return const_cast< TiXmlElement*
>( (
const_cast< const TiXmlNode*
>(
this))->FirstChildElement( _value ) );
689 const TiXmlElement* FirstChildElement(
const std::string& _value )
const {
return FirstChildElement (_value.c_str ()); }
690 TiXmlElement* FirstChildElement(
const std::string& _value ) {
return FirstChildElement (_value.c_str ()); }
697 int Type()
const {
return type; }
762 virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0;
766 TiXmlNode* Identify(
const char* start, TiXmlEncoding encoding );
805 TiXmlAttribute(
const std::string& _name,
const std::string& _value )
824 const char*
Name()
const {
return name.c_str(); }
825 const char*
Value()
const {
return value.c_str(); }
827 const std::string& ValueStr()
const {
return value; }
829 int IntValue()
const;
830 double DoubleValue()
const;
833 const TIXML_STRING& NameTStr()
const {
return name; }
844 int QueryIntValue(
int* _value )
const;
846 int QueryDoubleValue(
double* _value )
const;
848 void SetName(
const char* _name ) { name = _name; }
849 void SetValue(
const char* _value ) { value = _value; }
851 void SetIntValue(
int _value );
852 void SetDoubleValue(
double _value );
855 void SetName(
const std::string& _name ) { name = _name; }
858 void SetValue(
const std::string& _value ) { value = _value; }
862 const TiXmlAttribute* Next()
const;
863 TiXmlAttribute* Next() {
864 return const_cast< TiXmlAttribute*
>( (
const_cast< const TiXmlAttribute*
>(
this))->Next() );
868 const TiXmlAttribute* Previous()
const;
869 TiXmlAttribute* Previous() {
870 return const_cast< TiXmlAttribute*
>( (
const_cast< const TiXmlAttribute*
>(
this))->Previous() );
873 bool operator==(
const TiXmlAttribute& rhs )
const {
return rhs.name == name; }
874 bool operator<(
const TiXmlAttribute& rhs )
const {
return name < rhs.name; }
875 bool operator>(
const TiXmlAttribute& rhs )
const {
return name > rhs.name; }
880 virtual const char* Parse(
const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
883 virtual void Print( FILE* cfile,
int depth )
const {
884 Print( cfile, depth, 0 );
886 void Print( FILE* cfile,
int depth, TIXML_STRING* str )
const;
893 TiXmlAttribute(
const TiXmlAttribute& );
894 void operator=(
const TiXmlAttribute& base );
896 TiXmlDocument* document;
899 TiXmlAttribute* prev;
900 TiXmlAttribute* next;
922 void *
operator new (
size_t size);
923 void *
operator new[](
size_t size);
924 void operator delete (
void* ptr);
925 void operator delete[](
void* ptr);
930 const TiXmlAttribute* First()
const {
return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
931 TiXmlAttribute* First() {
return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
932 const TiXmlAttribute* Last()
const {
return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
933 TiXmlAttribute* Last() {
return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
981 const char* Attribute(
const char* name )
const;
989 const char* Attribute(
const char* name,
int* i )
const;
997 const char* Attribute(
const char* name,
double* d )
const;
1006 int QueryIntAttribute(
const char* name,
int* _value )
const;
1008 int QueryDoubleAttribute(
const char* name,
double* _value )
const;
1012 int result = QueryDoubleAttribute( name, &d );
1013 if ( result == TIXML_SUCCESS ) {
1019 #ifdef TIXML_USE_STL
1028 template<
typename T >
int QueryValueAttribute(
const std::string& name, T* outValue )
const
1032 return TIXML_NO_ATTRIBUTE;
1034 std::stringstream sstream( node->ValueStr() );
1035 sstream >> *outValue;
1036 if ( !sstream.fail() )
1037 return TIXML_SUCCESS;
1038 return TIXML_WRONG_TYPE;
1060 void SetAttribute(
const char* name,
const char * _value );
1062 #ifdef TIXML_USE_STL
1063 const std::string* Attribute(
const std::string& name )
const;
1064 const std::string* Attribute(
const std::string& name,
int* i )
const;
1065 const std::string* Attribute(
const std::string& name,
double* d )
const;
1066 int QueryIntAttribute(
const std::string& name,
int* _value )
const;
1067 int QueryDoubleAttribute(
const std::string& name,
double* _value )
const;
1070 void SetAttribute(
const std::string& name,
const std::string& _value );
1072 void SetAttribute(
const std::string& name,
int _value );
1078 void SetAttribute(
const char * name,
int value );
1083 void SetDoubleAttribute(
const char * name,
double value );
1087 void RemoveAttribute(
const char * name );
1088 #ifdef TIXML_USE_STL
1089 void RemoveAttribute(
const std::string& name ) { RemoveAttribute (name.c_str ()); }
1093 TiXmlAttribute* FirstAttribute() {
return attributeSet.First(); }
1129 const char* GetText()
const;
1132 virtual TiXmlNode* Clone()
const;
1134 virtual void Print( FILE* cfile,
int depth )
const;
1139 virtual const char* Parse(
const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
1154 #ifdef TIXML_USE_STL
1155 virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
1161 const char* ReadValue(
const char* in,
TiXmlParsingData* prevData, TiXmlEncoding encoding );
1186 virtual TiXmlNode* Clone()
const;
1188 virtual void Print( FILE* cfile,
int depth )
const;
1193 virtual const char* Parse(
const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
1206 #ifdef TIXML_USE_STL
1207 virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
1231 SetValue( initValue );
1236 #ifdef TIXML_USE_STL
1237 TiXmlText(
const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT)
1240 SetValue( initValue );
1245 TiXmlText(
const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo(
this ); }
1246 void operator=(
const TiXmlText& base ) { base.CopyTo(
this ); }
1249 virtual void Print( FILE* cfile,
int depth )
const;
1256 virtual const char* Parse(
const char* p,
TiXmlParsingData* data, TiXmlEncoding encoding );
1272 #ifdef TIXML_USE_STL
1273 virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
1300 #ifdef TIXML_USE_STL
1303 const std::string& _encoding,
1304 const std::string& _standalone );
1309 const char* _encoding,
1310 const char* _standalone );
1318 const char *
Version()
const {
return version.c_str (); }
1320 const char *
Encoding()
const {
return encoding.c_str (); }
1327 virtual void Print( FILE* cfile,
int depth, TIXML_STRING* str )
const;
1328 virtual void Print( FILE* cfile,
int depth )
const {
1329 Print( cfile, depth, 0 );
1332 virtual const char* Parse(
const char* p,
TiXmlParsingData* data, TiXmlEncoding encoding );
1344 #ifdef TIXML_USE_STL
1345 virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
1350 TIXML_STRING version;
1351 TIXML_STRING encoding;
1352 TIXML_STRING standalone;
1370 void operator=(
const TiXmlUnknown& copy ) { copy.CopyTo(
this ); }
1375 virtual void Print( FILE* cfile,
int depth )
const;
1377 virtual const char* Parse(
const char* p,
TiXmlParsingData* data, TiXmlEncoding encoding );
1389 #ifdef TIXML_USE_STL
1390 virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
1410 #ifdef TIXML_USE_STL
1424 bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
1426 bool SaveFile()
const;
1428 bool LoadFile(
const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
1430 bool SaveFile(
const char * filename )
const;
1436 bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
1438 bool SaveFile( FILE* )
const;
1440 #ifdef TIXML_USE_STL
1441 bool LoadFile(
const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING )
1445 return LoadFile( filename.c_str(), encoding );
1447 bool SaveFile(
const std::string& filename )
const
1451 return SaveFile( filename.c_str() );
1459 virtual const char* Parse(
const char* p,
TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
1466 TiXmlElement* RootElement() {
return FirstChildElement(); }
1476 const char *
ErrorDesc()
const {
return errorDesc.c_str (); }
1519 int TabSize()
const {
return tabsize; }
1527 errorLocation.row = errorLocation.col = 0;
1541 virtual void Print( FILE* cfile,
int depth = 0 )
const;
1543 void SetError(
int err,
const char* errorLocation,
TiXmlParsingData* prevData, TiXmlEncoding encoding );
1555 #ifdef TIXML_USE_STL
1556 virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
1564 TIXML_STRING errorDesc;
1567 bool useMicrosoftBOM;
1659 void *
operator new (
size_t size);
1660 void *
operator new[](
size_t size);
1661 void operator delete (
void* ptr);
1662 void operator delete[](
void* ptr);
1667 TiXmlHandle FirstChild()
const;
1669 TiXmlHandle FirstChild(
const char * value )
const;
1671 TiXmlHandle FirstChildElement()
const;
1673 TiXmlHandle FirstChildElement(
const char * value )
const;
1678 TiXmlHandle Child(
const char* value,
int index )
const;
1682 TiXmlHandle Child(
int index )
const;
1687 TiXmlHandle ChildElement(
const char* value,
int index )
const;
1692 TiXmlHandle ChildElement(
int index )
const;
1694 #ifdef TIXML_USE_STL
1695 TiXmlHandle FirstChild(
const std::string& _value )
const {
return FirstChild( _value.c_str() ); }
1696 TiXmlHandle FirstChildElement(
const std::string& _value )
const {
return FirstChildElement( _value.c_str() ); }
1698 TiXmlHandle Child(
const std::string& _value,
int index )
const {
return Child( _value.c_str(), index ); }
1699 TiXmlHandle ChildElement(
const std::string& _value,
int index )
const {
return ChildElement( _value.c_str(), index ); }
1760 buffer(), indent(
" " ), lineBreak(
"\n" ) {}
1769 virtual bool Visit(
const TiXmlText& text );
1776 void SetIndent(
const char* _indent ) { indent = _indent ? _indent :
"" ; }
1778 const char*
Indent() {
return indent.c_str(); }
1783 void SetLineBreak(
const char* _lineBreak ) { lineBreak = _lineBreak ? _lineBreak :
""; }
1794 const char*
CStr() {
return buffer.c_str(); }
1796 size_t Size() {
return buffer.size(); }
1798 #ifdef TIXML_USE_STL
1799 const std::string& Str() {
return buffer; }
1805 for(
int i=0; i<depth; ++i )
1808 void DoLineBreak() {
1809 buffer += lineBreak;
1813 bool simpleTextPrint;
1814 TIXML_STRING buffer;
1815 TIXML_STRING indent;
1816 TIXML_STRING lineBreak;
1822 #pragma warning( pop )
virtual bool Visit(const TiXmlDeclaration &)
Visit a declaration.
Definition: tinyxml.h:152
virtual const TiXmlText * ToText() const
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:714
TiXmlDeclaration()
Construct an empty declaration.
Definition: tinyxml.h:1298
static bool IsWhiteSpaceCondensed()
Return the current white space setting.
Definition: tinyxml.h:237
const char * Name() const
Return the name of this attribute.
Definition: tinyxml.h:824
virtual const TiXmlDeclaration * ToDeclaration() const
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:715
virtual void Print(FILE *cfile, int depth) const =0
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL ...
virtual bool Visit(const TiXmlText &)
Visit a text node.
Definition: tinyxml.h:154
If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks.
Definition: tinyxml.h:132
virtual TiXmlUnknown * ToUnknown()
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:720
TiXmlText * ToText() const
Return the handle as a TiXmlText.
Definition: tinyxml.h:1710
The parent class for everything in the Document Object Model.
Definition: tinyxml.h:437
virtual bool Accept(TiXmlVisitor *visitor) const =0
Accept a hierchical visit the nodes in the TinyXML DOM.
void SetLineBreak(const char *_lineBreak)
Set the line breaking string.
Definition: tinyxml.h:1783
Any tag that tinyXml doesn't recognize is saved as an unknown.
Definition: tinyxml.h:1364
TiXmlBase is a base class for every class in TinyXml.
Definition: tinyxml.h:203
Print to memory functionality.
Definition: tinyxml.h:1757
TiXmlNode * LastChild()
The last child of this node. Will be null if there are no children.
Definition: tinyxml.h:545
virtual TiXmlText * ToText()
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:1259
virtual void Print(FILE *cfile, int depth) const
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL ...
Definition: tinyxml.h:1328
const TiXmlNode * PreviousSibling() const
Navigate to a sibling node.
Definition: tinyxml.h:627
TiXmlNode * ToNode() const
Return the handle as a TiXmlNode.
Definition: tinyxml.h:1704
virtual bool Visit(const TiXmlUnknown &)
Visit an unknow node.
Definition: tinyxml.h:158
virtual bool VisitEnter(const TiXmlDocument &)
Visit a document.
Definition: tinyxml.h:142
virtual TiXmlUnknown * ToUnknown()
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:1380
virtual TiXmlElement * ToElement()
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:1142
int Row() const
Return the position, in the original source file, of this node or attribute.
Definition: tinyxml.h:257
virtual bool Visit(const TiXmlComment &)
Visit a comment node.
Definition: tinyxml.h:156
virtual const TiXmlDocument * ToDocument() const
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:710
int Type() const
Query the type (as an enumerated value, above) of this node.
Definition: tinyxml.h:697
NodeType
The types of XML nodes supported by TinyXml.
Definition: tinyxml.h:476
TiXmlAttribute(const char *_name, const char *_value)
Construct an attribute with a name and value.
Definition: tinyxml.h:816
virtual TiXmlElement * ToElement()
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:718
TiXmlHandle(TiXmlNode *_node)
Create a handle from any node (at any depth of the tree.) This can be a null pointer.
Definition: tinyxml.h:1655
Definition: tinyxml.h:917
size_t Size()
Return the length of the result string.
Definition: tinyxml.h:1796
int Column() const
See Row()
Definition: tinyxml.h:258
virtual TiXmlDocument * ToDocument()
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:717
virtual TiXmlDeclaration * ToDeclaration()
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:722
void SetStreamPrinting()
Switch over to "stream printing" which is the most dense formatting without linebreaks.
Definition: tinyxml.h:1790
const char * LineBreak()
Query the current line breaking string.
Definition: tinyxml.h:1785
static void SetCondenseWhiteSpace(bool condense)
The world does not agree on whether white space should be kept or not.
Definition: tinyxml.h:234
void SetUserData(void *user)
Set a pointer to arbitrary user data.
Definition: tinyxml.h:260
TiXmlUnknown * ToUnknown() const
Return the handle as a TiXmlUnknown.
Definition: tinyxml.h:1713
XML text.
Definition: tinyxml.h:1222
int QueryFloatAttribute(const char *name, float *_value) const
QueryFloatAttribute examines the attribute - see QueryIntAttribute().
Definition: tinyxml.h:1010
void * userData
Field containing a generic user pointer.
Definition: tinyxml.h:389
void Print() const
Write the document to standard out using formatted printing ("pretty print").
Definition: tinyxml.h:1532
const char * Value() const
The meaning of 'value' changes for the specific type of TiXmlNode.
Definition: tinyxml.h:500
int ErrorId() const
Generally, you probably want the error string ( ErrorDesc() ).
Definition: tinyxml.h:1481
TiXmlNode * Parent()
One step up the DOM.
Definition: tinyxml.h:532
const TiXmlElement * RootElement() const
Get the root element – the only top level element – of the document.
Definition: tinyxml.h:1465
Definition: tinyxmlparser.cpp:177
TiXmlText(const char *initValue)
Constructor for text element.
Definition: tinyxml.h:1229
TiXmlAttribute()
Construct an empty attribute.
Definition: tinyxml.h:798
The element is a container class.
Definition: tinyxml.h:962
void SetTabSize(int _tabsize)
SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to report the correct v...
Definition: tinyxml.h:1517
const char * ErrorDesc() const
Contains a textual (english) description of the error if one occurs.
Definition: tinyxml.h:1476
virtual const TiXmlUnknown * ToUnknown() const
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:1379
const char * Encoding() const
Encoding. Will return an empty string if none was found.
Definition: tinyxml.h:1320
const void * GetUserData() const
Get a pointer to arbitrary user data.
Definition: tinyxml.h:262
virtual bool VisitExit(const TiXmlDocument &)
Visit a document.
Definition: tinyxml.h:144
const char * Version() const
Version. Will return an empty string if none was found.
Definition: tinyxml.h:1318
const TiXmlAttribute * LastAttribute() const
Access the last attribute in this element.
Definition: tinyxml.h:1094
virtual const TiXmlDocument * ToDocument() const
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:1545
void SetCDATA(bool _cdata)
Turns on or off a CDATA representation of text.
Definition: tinyxml.h:1254
virtual TiXmlText * ToText()
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:721
virtual const TiXmlUnknown * ToUnknown() const
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:713
Always the top level node.
Definition: tinyxml.h:1403
Definition: tinyxml.h:104
TiXmlNode * LastChild(const char *_value)
The last child of this node matching 'value'. Will be null if there are no children.
Definition: tinyxml.h:548
TiXmlNode * Node() const
Definition: tinyxml.h:1718
virtual TiXmlNode * Clone() const =0
Create an exact duplicate of this node and return it.
virtual const TiXmlText * ToText() const
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:1258
void SetValue(const char *_value)
Changes the value of the node.
Definition: tinyxml.h:521
In correct XML the declaration is the first entry in the file.
Definition: tinyxml.h:1295
TiXmlElement * Element() const
Definition: tinyxml.h:1722
virtual const TiXmlDeclaration * ToDeclaration() const
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:1334
bool Error() const
If an error occurs, Error will be set to true.
Definition: tinyxml.h:1473
const TiXmlNode * FirstChild() const
The first child of this node. Will be null if there are no children.
Definition: tinyxml.h:535
const TiXmlNode * NextSibling() const
Navigate to a sibling node.
Definition: tinyxml.h:644
int ErrorCol() const
The column where the error occured. See ErrorRow()
Definition: tinyxml.h:1491
virtual TiXmlDocument * ToDocument()
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:1546
void SetIndent(const char *_indent)
Set the indent characters for printing.
Definition: tinyxml.h:1776
virtual bool VisitEnter(const TiXmlElement &, const TiXmlAttribute *)
Visit an element.
Definition: tinyxml.h:147
virtual const TiXmlComment * ToComment() const
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:712
virtual TiXmlDeclaration * ToDeclaration()
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:1335
void ClearError()
If you have handled the error, it can be reset with this call.
Definition: tinyxml.h:1524
virtual const TiXmlElement * ToElement() const
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:711
void SetName(const char *_name)
Set the name of this attribute.
Definition: tinyxml.h:848
const char * Indent()
Query the indention string.
Definition: tinyxml.h:1778
void * GetUserData()
Get a pointer to arbitrary user data.
Definition: tinyxml.h:261
A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thi...
Definition: tinyxml.h:1652
bool NoChildren() const
Returns true if this node has no children.
Definition: tinyxml.h:708
TiXmlText * Text() const
Definition: tinyxml.h:1726
TiXmlUnknown * Unknown() const
Definition: tinyxml.h:1730
const char * CStr()
Return the result.
Definition: tinyxml.h:1794
const char * Value() const
Return the value of this attribute.
Definition: tinyxml.h:825
TiXmlHandle(const TiXmlHandle &ref)
Copy constructor.
Definition: tinyxml.h:1657
void SetValue(const char *_value)
Set the value.
Definition: tinyxml.h:849
TiXmlElement * ToElement() const
Return the handle as a TiXmlElement.
Definition: tinyxml.h:1707
const char * Standalone() const
Is this a standalone document?
Definition: tinyxml.h:1322
An attribute is a name-value pair.
Definition: tinyxml.h:793
bool CDATA() const
Queries whether this represents text using a CDATA section.
Definition: tinyxml.h:1252
virtual bool VisitExit(const TiXmlElement &)
Visit an element.
Definition: tinyxml.h:149
virtual TiXmlComment * ToComment()
Cast to a more defined type. Will return null if not of the requested type.
Definition: tinyxml.h:719
virtual const TiXmlElement * ToElement() const
Cast to a more defined type. Will return null not of the requested type.
Definition: tinyxml.h:1141
int ErrorRow() const
Returns the location (if known) of the error.
Definition: tinyxml.h:1490
virtual void Print(FILE *cfile, int depth) const
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL ...
Definition: tinyxml.h:883
const TiXmlAttribute * FirstAttribute() const
Access the first attribute in this element.
Definition: tinyxml.h:1092