37 FILE*
TiXmlFOpen(
const char* filename,
const char* mode) {
38 #if defined(_MSC_VER) && (_MSC_VER >= 1400
) 40 errno_t err = fopen_s(&fp, filename, mode);
42 if (!err && fp)
return fp;
46 return fopen(filename, mode);
53 while (i < (
int)str.length()) {
54 unsigned char c = (
unsigned char)str[i];
56 if (c ==
'&' && i < ((
int)str.length() - 2) && str[i + 1] ==
'#' &&
68 while (i < (
int)str.length() - 1) {
69 outString->append(str.c_str() + i, 1);
72 if (str[i] ==
';')
break;
74 }
else if (c ==
'&') {
75 outString->append(entity[0].str, entity[0].strLength);
77 }
else if (c ==
'<') {
78 outString->append(entity[1].str, entity[1].strLength);
80 }
else if (c ==
'>') {
81 outString->append(entity[2].str, entity[2].strLength);
83 }
else if (c ==
'\"') {
84 outString->append(entity[3].str, entity[3].strLength);
86 }
else if (c ==
'\'') {
87 outString->append(entity[4].str, entity[4].strLength);
94 #if defined(TIXML_SNPRINTF
) 95 TIXML_SNPRINTF(buf,
sizeof(buf),
"&#x%02X;", (
unsigned)(c & 0xff));
97 sprintf(buf,
"&#x%02X;", (
unsigned)(c & 0xff));
102 outString->append(buf, (
int)strlen(buf));
107 *outString += (
char)c;
135 target->SetValue(value.c_str());
155 assert(node->GetDocument() == 0 || node->GetDocument() ==
this->GetDocument());
161 GetDocument()->SetError(
162 TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN);
184 GetDocument()->SetError(
185 TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN);
199 if (!beforeThis || beforeThis
->parent !=
this) {
205 GetDocument()->SetError(
206 TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN);
233 if (!afterThis || afterThis
->parent !=
this) {
239 GetDocument()->SetError(
240 TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN);
267 if (replaceThis
->parent !=
this)
return 0;
315 if (strcmp(node
->Value(), _value) == 0)
return node;
325 if (strcmp(node
->Value(), _value) == 0)
return node;
354 if (strcmp(node
->Value(), _value) == 0)
return node;
364 if (strcmp(node
->Value(), _value) == 0)
return node;
375 TiXmlAttribute* node = attributeSet.Find(name);
379 attributeSet.Remove(node);
427 for (node =
this; node; node = node
->parent) {
428 if (node->ToDocument())
return node->ToDocument();
464 while (attributeSet.First()) {
465 TiXmlAttribute* node = attributeSet.First();
466 attributeSet.Remove(node);
483 if (node)
return &node->ValueStr();
505 const std::string* s = Attribute(name);
509 *i = atoi(s->c_str());
536 const std::string* s = Attribute(name);
540 *d = atof(s->c_str());
578 double* dval)
const {
589 #if defined(TIXML_SNPRINTF
) 590 TIXML_SNPRINTF(buf,
sizeof(buf),
"%d", val);
592 sprintf(buf,
"%d", val);
599 std::ostringstream oss;
601 SetAttribute(name, oss.str());
607 #if defined(TIXML_SNPRINTF
) 608 TIXML_SNPRINTF(buf,
sizeof(buf),
"%f", val);
610 sprintf(buf,
"%f", val);
620 const char* _name = cname;
621 const char* _value = cvalue;
627 node->SetValue(_value);
634 attributeSet.Add(attrib);
645 const std::string& _value) {
649 node->SetValue(_value);
656 attributeSet.Add(attrib);
670 for (i = 0; i < depth; i++) {
674 fprintf(cfile,
"<%s", value.c_str());
678 for (attrib = attributeSet.First(); attrib; attrib = attrib
->Next()) {
690 fprintf(cfile,
" />");
693 firstChild->Print(cfile, depth + 1);
694 fprintf(cfile,
"</%s>", value.c_str());
700 fprintf(cfile,
"\n");
703 node->Print(cfile, depth + 1);
706 fprintf(cfile,
"\n");
708 for (i = 0; i < depth; ++i) {
712 fprintf(cfile,
"</%s>", value.c_str());
718 TiXmlNode::CopyTo(target);
724 for (attribute = attributeSet.First(); attribute;
732 target->LinkEndChild(node->Clone());
737 if (visitor->VisitEnter(*
this, attributeSet.First())) {
749 if (!clone)
return 0;
756 const TiXmlNode* child =
this->FirstChild();
762 return childText->Value();
780 value = documentName;
789 value = documentName;
808 return LoadFile(Value(), encoding);
819 return SaveFile(Value());
834 FILE* file = TiXmlFOpen(value.c_str(),
"rb");
858 fseek(file, 0, SEEK_END);
859 length = ftell(file);
860 fseek(file, 0, SEEK_SET);
873 data.reserve(length);
904 char* buf =
new char[length + 1];
907 if (fread(buf, length, 1, file) != 1) {
913 const char* lastPos = buf;
919 assert(p < (buf + length));
924 data.append(lastPos, (p - lastPos + 1));
927 assert(p <= (buf + length));
928 }
else if (*p == 0xd) {
931 if ((p - lastPos) > 0) {
932 data.append(lastPos, p - lastPos);
937 if (*(p + 1) == 0xa) {
941 assert(p <= (buf + length));
947 assert(p <= (buf + length));
956 data.append(lastPos, p - lastPos);
962 Parse(data.c_str(), 0, encoding);
985 const unsigned char TIXML_UTF_LEAD_0 = 0xefU;
986 const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;
987 const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;
989 fputc(TIXML_UTF_LEAD_0, fp);
990 fputc(TIXML_UTF_LEAD_1, fp);
991 fputc(TIXML_UTF_LEAD_2, fp);
995 return (ferror(fp) == 0);
999 TiXmlNode::CopyTo(target);
1003 target->errorDesc = errorDesc;
1011 target->LinkEndChild(node->Clone());
1018 if (!clone)
return 0;
1028 node->Print(cfile, depth);
1029 fprintf(cfile,
"\n");
1034 if (visitor->VisitEnter(*
this)) {
1040 return visitor->VisitExit(*
this);
1046 if (next->value.empty() && next->name.empty())
return 0;
1065 if (prev->value.empty() && prev->name.empty())
return 0;
1084 EncodeString(name, &n);
1085 EncodeString(value, &v);
1089 fprintf(cfile,
"%s=\"%s\"", n.c_str(), v.c_str());
1100 fprintf(cfile,
"%s='%s'", n.c_str(), v.c_str());
1126 #if defined(TIXML_SNPRINTF
) 1127 TIXML_SNPRINTF(buf,
sizeof(buf),
"%d", _value);
1129 sprintf(buf,
"%d", _value);
1136 #if defined(TIXML_SNPRINTF
) 1137 TIXML_SNPRINTF(buf,
sizeof(buf),
"%g", _value);
1139 sprintf(buf,
"%lf", _value);
1161 for (
int i = 0; i < depth; i++) {
1162 fprintf(cfile,
" ");
1165 fprintf(cfile,
"<!--%s-->", value.c_str());
1169 TiXmlNode::CopyTo(target);
1179 if (!clone)
return 0;
1190 fprintf(cfile,
"\n");
1192 for (i = 0; i < depth; i++) {
1193 fprintf(cfile,
" ");
1196 fprintf(cfile,
"<![CDATA[%s]]>\n", value.c_str());
1199 EncodeString(value, &buffer);
1200 fprintf(cfile,
"%s", buffer.c_str());
1205 TiXmlNode::CopyTo(target);
1217 if (!clone)
return 0;
1224 const char* _encoding,
1225 const char* _standalone)
1228 encoding = _encoding;
1229 standalone = _standalone;
1234 const std::string& _encoding,
1235 const std::string& _standalone)
1238 encoding = _encoding;
1239 standalone = _standalone;
1254 if (cfile) fprintf(cfile,
"<?xml ");
1256 if (str) (*str) +=
"<?xml ";
1258 if (!version.empty()) {
1259 if (cfile) fprintf(cfile,
"version=\"%s\" ", version.c_str());
1262 (*str) +=
"version=\"";
1268 if (!encoding.empty()) {
1269 if (cfile) fprintf(cfile,
"encoding=\"%s\" ", encoding.c_str());
1272 (*str) +=
"encoding=\"";
1278 if (!standalone.empty()) {
1279 if (cfile) fprintf(cfile,
"standalone=\"%s\" ", standalone.c_str());
1282 (*str) +=
"standalone=\"";
1283 (*str) += standalone;
1288 if (cfile) fprintf(cfile,
"?>");
1290 if (str) (*str) +=
"?>";
1294 TiXmlNode::CopyTo(target);
1296 target->version = version;
1297 target->encoding = encoding;
1298 target->standalone = standalone;
1308 if (!clone)
return 0;
1323 const std::string& _href)
1344 if (cfile) fprintf(cfile,
"<?xml-stylesheet ");
1346 if (str) (*str) +=
"<?xml-stylesheet ";
1348 if (!type.empty()) {
1349 if (cfile) fprintf(cfile,
"type=\"%s\" ", type.c_str());
1352 (*str) +=
"type=\"";
1358 if (!href.empty()) {
1359 if (cfile) fprintf(cfile,
"href=\"%s\" ", href.c_str());
1362 (*str) +=
"href=\"";
1368 if (cfile) fprintf(cfile,
"?>");
1370 if (str) (*str) +=
"?>";
1374 TiXmlNode::CopyTo(target);
1376 target->type = type;
1377 target->href = href;
1387 if (!clone)
return 0;
1394 for (
int i = 0; i < depth; i++)
1395 fprintf(cfile,
" ");
1397 fprintf(cfile,
"<%s>", value.c_str());
1401 TiXmlNode::CopyTo(target);
1411 if (!clone)
return 0;
1418 sentinel.next = &sentinel;
1419 sentinel.prev = &sentinel;
1423 assert(sentinel.next == &sentinel);
1424 assert(sentinel.prev == &sentinel);
1432 assert(!Find(addMe->Name()));
1435 addMe->next = &sentinel;
1436 addMe->prev = sentinel.prev;
1438 sentinel.prev->next = addMe;
1439 sentinel.prev = addMe;
1445 for (node = sentinel.next; node != &sentinel; node = node->next) {
1446 if (node == removeMe) {
1447 node->prev->next = node->next;
1448 node->next->prev = node->prev;
1460 for (
const TiXmlAttribute* node = sentinel.next; node != &sentinel;
1461 node = node->next) {
1462 if (node->name == name)
return node;
1483 for (
const TiXmlAttribute* node = sentinel.next; node != &sentinel;
1484 node = node->next) {
1485 if (strcmp(node->name.c_str(), name) == 0)
return node;
1507 tag.reserve(8 * 1000);
1508 base.StreamIn(&in, &tag);
1510 base.Parse(tag.c_str(), 0, TIXML_DEFAULT_ENCODING);
1519 base.Accept(&printer);
1520 out << printer.Str();
1528 base.Accept(&printer);
1529 out.append(printer.Str());
1559 if (child)
return TiXmlHandle(child);
1569 if (child)
return TiXmlHandle(child);
1595 for (i = 0; child && i < count; child = child
->NextSibling(value
), ++i) {
1610 for (i = 0; child && i < count; child = child->NextSiblingElement(), ++i) {
1614 if (child)
return TiXmlHandle(child);
1625 for (i = 0; child && i < count;
1626 child = child->NextSiblingElement(value), ++i) {
1630 if (child)
return TiXmlHandle(child);
1644 buffer += element.Value();
1649 attrib->Print(0, 0, &buffer);
1652 if (!element.FirstChild()) {
1658 if (element.FirstChild()->ToText() &&
1659 element.LastChild() == element.FirstChild() &&
1660 element.FirstChild()->ToText()->CDATA() ==
false) {
1675 if (!element.FirstChild()) {
1685 buffer += element.Value();
1696 buffer +=
"<![CDATA[";
1697 buffer += text.Value();
1702 TiXmlBase::EncodeString(text.ValueTStr(), &str);
1707 TiXmlBase::EncodeString(text.ValueTStr(), &str);
1717 declaration.Print(0, 0, &buffer);
1725 buffer += comment.Value();
1734 buffer += unknown.Value();
1742 stylesheet.Print(0, 0, &buffer);
TiXmlStylesheetReference(const std::string &_type, const std::string &_href)
Constructor.
int QueryIntValue(int *_value) const
QueryIntValue examines the value string.
TiXmlNode * FirstChild(const char *_value)
virtual bool VisitExit(const TiXmlElement &element)
Visit an element.
bool SaveFile(FILE *) const
Save a file using the given FILE*. Returns true if successful.
An attribute is a name-value pair.
TiXmlHandle(TiXmlNode *_node)
Create a handle from any node (at any depth of the tree.) This can be a null pointer.
void Print(FILE *cfile, int depth, TIXML_STRING *str) const
TiXmlDocument(const char *documentName)
Create a document with a name. The name of the document is also the filename of the xml...
If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks...
TiXmlDeclaration(const std::string &_version, const std::string &_encoding, const std::string &_standalone)
Constructor.
FILE * TiXmlFOpen(const char *filename, const char *mode)
TiXmlDeclaration(const TiXmlDeclaration ©)
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 ...
virtual bool Visit(const TiXmlUnknown &)
Visit an unknow node.
void SetAttribute(const std::string &name, const std::string &_value)
STL std::string form.
TiXmlAttribute(const char *_name, const char *_value)
Construct an attribute with a name and value.
const char * Name() const
Return the name of this attribute.
const TiXmlNode * PreviousSibling(const char *) const
Navigate to a sibling node.
virtual void Print(FILE *cfile, int depth, TIXML_STRING *str) const
int QueryDoubleAttribute(const char *name, double *_value) const
QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
int QueryDoubleValue(double *_value) const
QueryDoubleValue examines the value string. See QueryIntValue().
void SetDoubleAttribute(const char *name, double value)
Sets an attribute of name to a given value.
virtual const TiXmlElement * ToElement() const
Cast to a more defined type. Will return null if not of the requested type.
void CopyTo(TiXmlDocument *target) const
std::string & operator<<(std::string &out, const TiXmlNode &base)
TiXmlHandle ChildElement(const char *value, int index) const
Return a handle to the "index" child element with the given name.
virtual void Print(FILE *cfile, int depth=0) const
Print this Document to a FILE stream.
const char * GetText() const
Convenience function for easy access to the text inside an element.
virtual bool Accept(TiXmlVisitor *content) const
Walk the XML tree visiting this node and all of its children.
virtual const TiXmlText * ToText() const
Cast to a more defined type. Will return null if not of the requested type.
bool Error() const
If an error occurs, Error will be set to true.
void operator=(const TiXmlDeclaration ©)
TiXmlElement * FirstChildElement(const char *_value)
void operator=(const TiXmlDocument ©)
TiXmlHandle FirstChildElement(const char *value) const
Return a handle to the first child element with the given name.
TiXmlHandle Child(int index) const
Return a handle to the "index" child.
virtual TiXmlNode * Clone() const
Creates a copy of this Unknown and returns it.
TiXmlNode * ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis)
Replace a child of this node.
virtual bool VisitExit(const TiXmlElement &)
Visit an element.
bool CDATA() const
Queries whether this represents text using a CDATA section.
TiXmlNode * NextSibling()
TiXmlDocument()
Create an empty document, that has no name.
virtual bool Accept(TiXmlVisitor *visitor) const
Walk the XML tree visiting this node and all of its children.
void CopyTo(TiXmlElement *target) const
TiXmlElement * FirstChildElement()
void ClearError()
If you have handled the error, it can be reset with this call.
void SetAttribute(const char *name, int value)
Sets an attribute of name to a given value.
void CopyTo(TiXmlUnknown *target) const
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 ...
TiXmlDocument(const TiXmlDocument ©)
bool LoadFile(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the current document value.
TiXmlNode * InsertEndChild(const TiXmlNode &addThis)
Add a new node related to this.
virtual bool VisitExit(const TiXmlDocument &doc)
Visit a document.
const TiXmlNode * NextSibling(const char *) const
Navigate to a sibling node with the given 'value'.
TiXmlNode * InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)
Add a new node related to this.
void CopyTo(TiXmlDeclaration *target) const
static bool condenseWhiteSpace
bool LoadFile(const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the given filename. Returns true if successful.
const TiXmlElement * NextSiblingElement(const char *) const
Convenience function to get through elements.
NodeType
The types of XML nodes supported by TinyXml.
TiXmlNode * LinkEndChild(TiXmlNode *addThis)
Add a new node related to this.
bool SaveFile() const
Save a file using the current document value. Returns true if successful.
TiXmlHandle Child(const char *value, int index) const
Return a handle to the "index" child with the given name.
const TiXmlElement * FirstChildElement() const
Convenience function to get through elements.
void SetDoubleValue(double _value)
Set the value from a double.
void * userData
Field containing a generic user pointer.
A stylesheet reference looks like this:
virtual bool Accept(TiXmlVisitor *visitor) const =0
Accept a hierchical visit the nodes in the TinyXML DOM.
const TiXmlNode * IterateChildren(const char *value, const TiXmlNode *previous) const
This flavor of IterateChildren searches for children with a particular 'value'.
In correct XML the declaration is the first entry in the file.
const char * Value() const
Return the value of this attribute.
std::istream & operator>>(std::istream &in, TiXmlNode &base)
Any tag that tinyXml doesn't recognize is saved as an unknown.
int QueryIntAttribute(const char *name, int *_value) const
QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer...
virtual bool Visit(const TiXmlText &)
Visit a text node.
int IntValue() const
Return the value of this attribute, converted to an integer.
TiXmlNode * NextSibling(const char *_next)
TiXmlStylesheetReference()
Construct an empty declaration.
void CopyTo(TiXmlStylesheetReference *target) const
virtual TiXmlNode * Clone() const
Creates a copy of this Declaration and returns it.
virtual TiXmlNode * Clone() const
[internal use] Creates a new Element and returns it.
const char * Value() const
The meaning of 'value' changes for the specific type of TiXmlNode.
void CopyTo(TiXmlText *target) const
const TiXmlAttribute * Find(const std::string &_name) const
void RemoveAttribute(const char *name)
Deletes an attribute with the given name.
void SetAttribute(const char *name, const char *_value)
Sets an attribute of name to a given value.
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 ...
double DoubleValue() const
Return the value of this attribute, converted to a double.
virtual bool Visit(const TiXmlStylesheetReference &)
Visit a stylesheet reference.
friend class TiXmlElement
virtual bool VisitEnter(const TiXmlElement &element, const TiXmlAttribute *firstAttribute)
Visit an element.
const TiXmlElement * NextSiblingElement() const
Convenience function to get through elements.
Always the top level node.
TiXmlHandle FirstChild() const
Return a handle to the first child node.
TiXmlElement(const char *in_value)
Construct an element.
const std::string * Attribute(const std::string &name, int *i) const
const char * Attribute(const char *name, double *d) const
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
void operator=(const TiXmlStylesheetReference ©)
virtual bool Visit(const TiXmlText &text)
Visit a text node.
TiXmlNode * InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis)
Add a new node related to this.
TiXmlHandle FirstChild(const char *value) const
Return a handle to the first child node with the given name.
void CopyTo(TiXmlNode *target) const
void Add(TiXmlAttribute *attribute)
A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thi...
virtual bool Visit(const TiXmlUnknown &unknown)
Visit an unknow node.
const TiXmlAttribute * Next() const
Get the next sibling attribute in the DOM. Returns null at end.
const TiXmlDocument * GetDocument() const
Return a pointer to the Document this node lives in.
bool LoadFile(FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the given FILE*.
virtual bool Accept(TiXmlVisitor *visitor) const
Walk the XML tree visiting this node and all of its children.
const TiXmlAttribute * Find(const char *_name) const
TiXmlStylesheetReference(const TiXmlStylesheetReference ©)
TiXmlBase is a base class for every class in TinyXml.
int Type() const
Query the type (as an enumerated value, above) of this node.
int QueryIntAttribute(const std::string &name, int *_value) const
const TiXmlNode * FirstChild() const
The first child of this node. Will be null if there are no children.
const char * Attribute(const char *name, int *i) const
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
virtual bool VisitEnter(const TiXmlDocument &doc)
Visit a document.
void operator=(const TiXmlElement &base)
virtual TiXmlNode * Clone() const
Creates a new Element and returns it - the returned element is a copy.
TiXmlDocument(const std::string &documentName)
Constructor.
void SetError(int err, const char *errorLocation, TiXmlParsingData *prevData, TiXmlEncoding encoding)
TiXmlNode(NodeType _type)
TiXmlHandle ChildElement(int index) const
Return a handle to the "index" child element.
The parent class for everything in the Document Object Model.
void SetIntValue(int _value)
Set the value from an integer.
Print to memory functionality.
virtual TiXmlNode * Clone() const
Creates a copy of this StylesheetReference and returns it.
const std::string * Attribute(const std::string &name, double *d) const
TiXmlElement(const std::string &_value)
std::string constructor.
virtual bool Visit(const TiXmlComment &)
Visit a comment node.
const TiXmlNode * FirstChild(const char *value) const
The first child of this node with the matching 'value'. Will be null if none found. The first child of this node with the matching 'value'. Will be null if none found.
virtual TiXmlNode * Clone() const
Create an exact duplicate of this node and return it.
const std::string * Attribute(const std::string &name) const
const char * Attribute(const char *name) const
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
virtual bool Visit(const TiXmlComment &comment)
Visit a comment node.
TiXmlText(const char *initValue)
Constructor for text element.
TiXmlDeclaration(const char *_version, const char *_encoding, const char *_standalone)
Construct.
const TiXmlElement * FirstChildElement(const char *_value) const
Convenience function to get through elements.
int QueryDoubleAttribute(const std::string &name, double *_value) const
bool RemoveChild(TiXmlNode *removeThis)
Delete a child of this node.
bool SaveFile(const char *filename) const
Save a file using the given filename. Returns true if successful.
TiXmlStylesheetReference(const char *_type, const char *_href)
Construct.
const TiXmlNode * LastChild(const char *value) const
void Remove(TiXmlAttribute *attribute)
void Clear()
Delete all the children of this node. Does not affect 'this'.
void SetValue(const char *_value)
Set the value.
const TiXmlAttribute * Previous() const
Get the previous sibling attribute in the DOM. Returns null at beginning.
const TiXmlNode * IterateChildren(const TiXmlNode *previous) const
An alternate way to walk the children of a node.
virtual bool Accept(TiXmlVisitor *content) const
Walk the XML tree visiting this node and all of its children.
virtual bool Accept(TiXmlVisitor *visitor) const
Walk the XML tree visiting this node and all of its children.
TiXmlHandle FirstChildElement() const
Return a handle to the first child element.
TiXmlDeclaration()
Construct an empty declaration.
void SetStreamPrinting()
Switch over to "stream printing" which is the most dense formatting without linebreaks.
virtual TiXmlNode * Clone() const =0
Create an exact duplicate of this node and return it.
virtual void Print(FILE *cfile, int depth, TIXML_STRING *str) const
const TiXmlNode * NextSibling() const
Navigate to a sibling node.
virtual bool Visit(const TiXmlDeclaration &declaration)
Visit a declaration.
TiXmlElement(const TiXmlElement &)
virtual TiXmlText * ToText()
Cast to a more defined type. Will return null if not of the requested type.
The element is a container class.
void SetAttribute(const std::string &name, int _value)
TiXmlCursor errorLocation
virtual bool Visit(const TiXmlStylesheetReference &stylesheet)
Visit a stylesheet reference.
virtual bool Accept(TiXmlVisitor *content) const
Walk the XML tree visiting this node and all of its children.
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 ...
virtual bool Visit(const TiXmlDeclaration &)
Visit a declaration.