Go to the documentation of this file.
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
55 #define TIXML_STRING TiXmlString
65 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
67 #define TIXML_SNPRINTF _snprintf_s
68 #define TIXML_SSCANF sscanf_s
69 #elif defined(_MSC_VER) && (_MSC_VER >= 1200)
72 #define TIXML_SNPRINTF _snprintf
73 #define TIXML_SSCANF sscanf
74 #elif defined(__GNUC__) && (__GNUC__ >= 3)
77 #define TIXML_SNPRINTF snprintf
78 #define TIXML_SSCANF sscanf
80 #define TIXML_SNPRINTF snprintf
81 #define TIXML_SSCANF sscanf
244 virtual void Print(FILE *cfile,
int depth)
const = 0;
283 void SetUserData(
void *user)
287 const void *GetUserData()
const
294 virtual const char *
Parse(
const char *p,
331 return (isspace((
unsigned char) c) || c ==
'\n' || c ==
'\r');
344 static bool StreamWhiteSpace( std::istream * in,
TIXML_STRING * tag );
345 static bool StreamTo( std::istream * in,
int character,
TIXML_STRING * tag );
357 static const char *
ReadText(
const char *in,
359 bool ignoreWhiteSpace,
395 for (
int i = 0; p[i] && i < *
length; ++i)
399 return p + (*length);
434 {
return tolower(v); }
502 friend std::ostream& operator<< (std::ostream& out,
const TiXmlNode& base);
505 friend std::string& operator<< (std::string& out,
const TiXmlNode& base );
538 {
return value.c_str(); }
545 const std::string& ValueStr()
const {
return value; }
564 void SetValue(
const std::string& _value ) {
value = _value; }
584 const char *
value)
const;
590 return const_cast< TiXmlNode *
> ((
const_cast< const TiXmlNode *
>(
this))->FirstChild(_value));
599 const char *
value)
const;
602 return const_cast< TiXmlNode *
> ((
const_cast< const TiXmlNode *
>(
this))->LastChild(_value));
632 return const_cast< TiXmlNode *
>((
const_cast< const TiXmlNode *
>(
this))->IterateChildren(previous));
640 return const_cast< TiXmlNode *
>((
const_cast< const TiXmlNode *
>(
this))->IterateChildren(_value, previous));
695 return const_cast< TiXmlNode *
>((
const_cast< const TiXmlNode *
>(
this))->PreviousSibling(_prev));
717 return const_cast< TiXmlNode *
>((
const_cast< const TiXmlNode *
>(
this))->NextSibling(_next));
739 return const_cast< TiXmlElement *
>((
const_cast< const TiXmlNode *
>(
this))->NextSiblingElement(_next));
760 return const_cast< TiXmlElement *
>((
const_cast< const TiXmlNode *
>(
this))->FirstChildElement(_value));
853 virtual void StreamIn( std::istream* in,
TIXML_STRING* tag ) = 0;
896 TiXmlAttribute(
const std::string& _name,
const std::string& _value )
915 const char *Name()
const
916 {
return name.c_str(); }
917 const char *Value()
const
918 {
return value.c_str(); }
920 const std::string& ValueStr()
const {
return value; }
944 void SetName(
const char *_name)
946 void SetValue(
const char *_value)
953 void SetName(
const std::string& _name ) {
name = _name; }
956 void SetValue(
const std::string& _value ) {
value = _value; }
990 virtual void Print(FILE *cfile,
int depth)
const
992 Print(cfile, depth, 0);
1053 # ifdef TIXML_USE_STL
1079 #ifdef TIXML_USE_STL
1093 const char *
Attribute(
const char *name)
const;
1101 const char *
Attribute(
const char *name,
int *i)
const;
1109 const char *
Attribute(
const char *name,
double *
d)
const;
1139 *_value = (float)
d;
1144 #ifdef TIXML_USE_STL
1145 int QueryStringAttribute(
const char* name, std::string* _value )
const {
1149 *_value = std::string( cstr );
1163 template<
typename T >
int QueryValueAttribute(
const std::string& name, T* outValue )
const
1169 std::stringstream sstream( node->ValueStr() );
1170 sstream >> *outValue;
1171 if ( !sstream.fail() )
1176 int QueryValueAttribute(
const std::string& name, std::string* outValue )
const
1181 *outValue = node->ValueStr();
1189 void SetAttribute(
const char *name,
const char *_value);
1191 #ifdef TIXML_USE_STL
1192 const std::string*
Attribute(
const std::string& name )
const;
1193 const std::string*
Attribute(
const std::string& name,
int* i )
const;
1194 const std::string*
Attribute(
const std::string& name,
double* d )
const;
1199 void SetAttribute(
const std::string& name,
const std::string& _value );
1201 void SetAttribute(
const std::string& name,
int _value );
1220 #ifdef TIXML_USE_STL
1272 virtual void Print(FILE *cfile,
int depth)
const;
1295 #ifdef TIXML_USE_STL
1296 virtual void StreamIn( std::istream * in,
TIXML_STRING * tag );
1336 virtual void Print(FILE *cfile,
int depth)
const;
1356 #ifdef TIXML_USE_STL
1357 virtual void StreamIn( std::istream * in,
TIXML_STRING * tag );
1389 #ifdef TIXML_USE_STL
1408 virtual void Print(FILE *cfile,
int depth)
const;
1437 #ifdef TIXML_USE_STL
1438 virtual void StreamIn( std::istream * in,
TIXML_STRING * tag );
1466 #ifdef TIXML_USE_STL
1469 const std::string& _encoding,
1470 const std::string& _standalone );
1475 const char *_encoding,
1476 const char *_standalone);
1503 virtual void Print(FILE *cfile,
int depth)
const
1505 Print(cfile, depth, 0);
1522 #ifdef TIXML_USE_STL
1523 virtual void StreamIn( std::istream * in,
TIXML_STRING * tag );
1563 virtual void Print(FILE *cfile,
int depth)
const;
1579 #ifdef TIXML_USE_STL
1580 virtual void StreamIn( std::istream * in,
TIXML_STRING * tag );
1601 #ifdef TIXML_USE_STL
1638 #ifdef TIXML_USE_STL
1693 int ErrorCol()
const
1740 {
Print(stdout, 0); }
1749 virtual void Print(FILE *cfile,
int depth = 0)
const;
1767 #ifdef TIXML_USE_STL
1768 virtual void StreamIn( std::istream * in,
TIXML_STRING * tag );
1868 { this->node = _node; }
1872 { this->node = ref.
node; }
1877 { this->node = ref.
node; }
1915 #ifdef TIXML_USE_STL
1919 TiXmlHandle Child(
const std::string& _value,
int index )
const {
return Child( _value.c_str(), index ); }
1931 {
return ((
node &&
node->ToElement()) ?
node->ToElement() : 0); }
1936 {
return ((
node &&
node->ToText()) ?
node->ToText() : 0); }
1941 {
return ((
node &&
node->ToUnknown()) ?
node->ToUnknown() : 0); }
2018 {
indent = _indent ? _indent :
""; }
2022 {
return indent.c_str(); }
2029 {
lineBreak = _lineBreak ? _lineBreak :
""; }
2046 {
return buffer.c_str(); }
2050 {
return buffer.size(); }
2052 #ifdef TIXML_USE_STL
2053 const std::string& Str() {
return buffer; }
2060 for (
int i = 0; i <
depth; ++i)
2078 #pragma warning( pop )
TiXmlAttributeSet attributeSet
static void ConvertUTF32ToUTF8(unsigned long input, char *output, int *length)
const TiXmlNode * LastChild() const
virtual const char * Parse(const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)=0
@ TIXML_ERROR_PARSING_COMMENT
virtual bool VisitExit(const TiXmlElement &)
Visit an element.
virtual const char * Parse(const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)
const char * Attribute(const char *name) const
void SetIndent(const char *_indent)
int IntValue() const
Return the value of this attribute, converted to an integer.
const TiXmlAttribute * Previous() const
Get the previous sibling attribute in the DOM. Returns null at beginning.
int QueryUnsignedAttribute(const char *name, unsigned *_value) const
QueryUnsignedAttribute examines the attribute - see QueryIntAttribute().
TiXmlHandle FirstChildElement() const
Return a handle to the first child element.
const TIXML_STRING & ValueTStr() const
TiXmlNode * IterateChildren(const char *_value, const TiXmlNode *previous)
virtual ~TiXmlDeclaration()
static bool IsWhiteSpace(char c)
virtual bool Accept(TiXmlVisitor *visitor) const
virtual void Print(FILE *cfile, int depth) const
@ TIXML_ERROR_READING_END_TAG
virtual TiXmlNode * Clone() const
virtual bool Visit(const TiXmlDeclaration &declaration)
Visit a declaration.
virtual TiXmlNode * Clone() const
Creates a copy of this Declaration and returns it.
void CopyTo(TiXmlText *target) const
TiXmlHandle ChildElement(const char *value, int index) const
TiXmlHandle(const TiXmlHandle &ref)
Copy constructor.
void SetDoubleAttribute(const char *name, double value)
TiXmlAttribute * LastAttribute()
TiXmlNode * NextSibling(const char *_next)
TiXmlAttribute * FindOrCreate(const char *_name)
void SetCDATA(bool _cdata)
Turns on or off a CDATA representation of text.
virtual bool Visit(const TiXmlDeclaration &)
Visit a declaration.
TiXmlNode * ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis)
virtual void Print(FILE *cfile, int depth) const
TiXmlText(const char *initValue)
void CopyTo(TiXmlUnknown *target) const
size_t Size()
Return the length of the result string.
static const char * GetEntity(const char *in, char *value, int *length, TiXmlEncoding encoding)
int QueryFloatAttribute(const char *name, float *_value) const
QueryFloatAttribute examines the attribute - see QueryIntAttribute().
const TiXmlNode * NextSibling() const
Navigate to a sibling node.
virtual bool Visit(const TiXmlText &)
Visit a text node.
virtual bool Accept(TiXmlVisitor *visitor) const
TiXmlHandle Child(const char *value, int index) const
@ TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME
void SetError(int err, const char *errorLocation, TiXmlParsingData *prevData, TiXmlEncoding encoding)
static void EncodeString(const TIXML_STRING &str, TIXML_STRING *out)
bool NoChildren() const
Returns true if this node has no children.
virtual bool Accept(TiXmlVisitor *content) const
@ TIXML_ERROR_PARSING_CDATA
virtual void Print(FILE *cfile, int depth) const
void CopyTo(TiXmlDeclaration *target) const
void operator=(const TiXmlAttributeSet &)
TiXmlNode * ToNode() const
virtual bool VisitEnter(const TiXmlDocument &doc)
Visit a document.
TiXmlElement * FirstChildElement(const char *_value)
TiXmlNode * LinkEndChild(TiXmlNode *addThis)
TiXmlElement * Element() const
const char * Encoding() const
Encoding. Will return an empty string if none was found.
void CopyTo(TiXmlNode *target) const
virtual const char * Parse(const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)
TiXmlUnknown & operator=(const TiXmlUnknown ©)
virtual const char * Parse(const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)
const char * Version() const
Version. Will return an empty string if none was found.
TiXmlAttribute * Find(const char *_name) const
const int TIXML_PATCH_VERSION
friend class TiXmlElement
virtual const char * Parse(const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)
const TiXmlNode * PreviousSibling() const
Navigate to a sibling node.
const char * ReadValue(const char *in, TiXmlParsingData *prevData, TiXmlEncoding encoding)
const TiXmlDocument * GetDocument() const
TiXmlDeclaration()
Construct an empty declaration.
const char * Indent()
Query the indention string.
@ TIXML_ERROR_READING_ELEMENT_VALUE
TiXmlElement & operator=(const TiXmlElement &base)
const TiXmlAttribute * Last() const
void operator=(const TiXmlBase &base)
@ TIXML_ERROR_READING_ATTRIBUTES
@ TIXML_ERROR_OPENING_FILE
void Clear()
Delete all the children of this node. Does not affect 'this'.
void operator=(const TiXmlNode &base)
TiXmlNode * LastChild()
The last child of this node. Will be null if there are no children.
TiXmlAttribute(const char *_name, const char *_value)
Construct an attribute with a name and value.
virtual bool Accept(TiXmlVisitor *content) const
TiXmlText & operator=(const TiXmlText &base)
bool operator<(const TiXmlAttribute &rhs) const
static bool StringEqual(const char *p, const char *endTag, bool ignoreCase, TiXmlEncoding encoding)
const TIXML_STRING & NameTStr() const
virtual TiXmlNode * Clone() const
[internal use] Creates a new Element and returns it.
const char * CStr()
Return the result.
@ TIXML_ERROR_PARSING_EMPTY
bool SaveFile() const
Save a file using the current document value. Returns true if successful.
virtual TiXmlNode * Clone() const =0
std::istream & operator>>(std::istream &str, CSVRow &data)
TiXmlDeclaration & operator=(const TiXmlDeclaration ©)
const TiXmlElement * NextSiblingElement() const
void RemoveAttribute(const char *name)
int QueryDoubleAttribute(const char *name, double *_value) const
QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
const char * Standalone() const
Is this a standalone document?
@ TIXML_ERROR_STRING_COUNT
@ TIXML_ERROR_DOCUMENT_EMPTY
void SetDocument(TiXmlDocument *doc)
int QueryDoubleValue(double *_value) const
QueryDoubleValue examines the value string. See QueryIntValue().
bool operator==(const TiXmlAttribute &rhs) const
static bool IsWhiteSpaceCondensed()
Return the current white space setting.
const char * LineBreak()
Query the current line breaking string.
int QueryIntValue(int *_value) const
void CopyTo(TiXmlElement *target) const
void SetAttribute(const char *name, const char *_value)
virtual TiXmlNode * Clone() const
Creates a new Element and returns it - the returned element is a copy.
virtual bool VisitEnter(const TiXmlDocument &)
Visit a document.
int QueryBoolAttribute(const char *name, bool *_value) const
TiXmlElement * NextSiblingElement(const char *_next)
@ TIXML_ERROR_PARSING_ELEMENT
TiXmlAttribute * Previous()
TiXmlElement * NextSiblingElement()
const TiXmlAttribute * Next() const
Get the next sibling attribute in the DOM. Returns null at end.
double DoubleValue() const
Return the value of this attribute, converted to a double.
TiXmlNode * PreviousSibling(const char *_prev)
TiXmlHandle FirstChild() const
Return a handle to the first child node.
TiXmlNode * InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)
const TiXmlEncoding TIXML_DEFAULT_ENCODING
void SetIntValue(int _value)
Set the value from an integer.
const TiXmlNode * Parent() const
static Entity entity[NUM_ENTITY]
virtual void Print(FILE *cfile, int depth) const
virtual bool Visit(const TiXmlUnknown &)
Visit an unknown node.
TiXmlNode * InsertEndChild(const TiXmlNode &addThis)
bool CDATA() const
Queries whether this represents text using a CDATA section.
static void SetCondenseWhiteSpace(bool condense)
const int TIXML_MAJOR_VERSION
void CopyTo(TiXmlDocument *target) const
virtual void Print(FILE *cfile, int depth) const =0
const char * ErrorDesc() const
Contains a textual (english) description of the error if one occurs.
virtual bool VisitExit(const TiXmlDocument &)
Visit a document.
@ TIXML_ERROR_PARSING_UNKNOWN
TiXmlNode * IterateChildren(const TiXmlNode *previous)
virtual const char * Parse(const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)
TiXmlDocument * GetDocument()
static const char * SkipWhiteSpace(const char *, TiXmlEncoding encoding)
void operator=(const TiXmlAttribute &base)
const TiXmlElement * RootElement() const
TiXmlElement * RootElement()
static bool condenseWhiteSpace
const TiXmlElement * FirstChildElement() const
Convenience function to get through elements.
const TiXmlAttribute * First() const
static const char * ReadName(const char *p, TIXML_STRING *name, TiXmlEncoding encoding)
TiXmlUnknown * ToUnknown() const
virtual void Print(FILE *cfile, int depth, TIXML_STRING *str) const
const char * Value() const
TiXmlElement * ToElement() const
virtual void Print(FILE *cfile, int depth) const
@ TIXML_ERROR_DOCUMENT_TOP_ONLY
TiXmlUnknown * Unknown() const
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
TiXmlAttribute()
Construct an empty attribute.
void Add(TiXmlAttribute *attribute)
void SetDoubleValue(double _value)
Set the value from a double.
TiXmlElement * FirstChildElement()
virtual const char * Parse(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
virtual bool VisitEnter(const TiXmlElement &, const TiXmlAttribute *)
Visit an element.
bool LoadFile(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
@ TIXML_ERROR_EMBEDDED_NULL
bool RemoveChild(TiXmlNode *removeThis)
Delete a child of this node.
static const char * ReadText(const char *in, TIXML_STRING *text, bool ignoreWhiteSpace, const char *endTag, bool ignoreCase, TiXmlEncoding encoding)
static int IsAlphaNum(unsigned char anyByte, TiXmlEncoding encoding)
int QueryIntAttribute(const char *name, int *_value) const
TiXmlAttribute * FirstAttribute()
void SetValue(const char *_value)
virtual bool VisitExit(const TiXmlDocument &doc)
Visit a document.
TiXmlNode * PreviousSibling()
void Remove(TiXmlAttribute *attribute)
void * userData
Field containing a generic user pointer.
static const int utf8ByteTable[256]
void SetLineBreak(const char *_lineBreak)
static const char * errorString[TIXML_ERROR_STRING_COUNT]
static int IsAlpha(unsigned char anyByte, TiXmlEncoding encoding)
TiXmlHandle operator=(const TiXmlHandle &ref)
TiXmlCursor errorLocation
TiXmlUnknown(const TiXmlUnknown ©)
virtual bool Accept(TiXmlVisitor *visitor) const =0
@ TIXML_ERROR_PARSING_DECLARATION
TiXmlNode * Identify(const char *start, TiXmlEncoding encoding)
virtual bool Accept(TiXmlVisitor *content) const
TiXmlDocument & operator=(const TiXmlDocument ©)
TiXmlText * ToText() const
TiXmlNode * InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis)
const char * GetText() const
static bool IsWhiteSpace(int c)
static int ToLower(int v, TiXmlEncoding encoding)
const int TIXML_MINOR_VERSION
TiXmlNode * LastChild(const char *_value)
The last child of this node matching 'value'. Will be null if there are no children.
static const char * GetChar(const char *p, char *_value, int *length, TiXmlEncoding encoding)
virtual bool Visit(const TiXmlComment &)
Visit a comment node.
TiXmlText(const TiXmlText ©)
TiXmlDocument()
Create an empty document, that has no name.
bool operator>(const TiXmlAttribute &rhs) const
const TiXmlNode * IterateChildren(const TiXmlNode *previous) const
TiXmlHandle(TiXmlNode *_node)
Create a handle from any node (at any depth of the tree.) This can be a null pointer.
TiXmlNode * NextSibling()
TiXmlNode * Parent()
One step up the DOM.
void SetTabSize(int _tabsize)
virtual TiXmlNode * Clone() const
Creates a copy of this Unknown and returns it.
sick_scan
Author(s): Michael Lehning
, Jochen Sprickerhof , Martin Günther
autogenerated on Thu Sep 8 2022 02:30:19