diff --git a/Engine/lib/CMakeLists.txt b/Engine/lib/CMakeLists.txt index 1000cba53..e3a28fbb5 100644 --- a/Engine/lib/CMakeLists.txt +++ b/Engine/lib/CMakeLists.txt @@ -186,7 +186,7 @@ mark_as_advanced(PNG_DEBUG) mark_as_advanced(PNG_FRAMEWORK) mark_as_advanced(PNG_PREFIX) -add_subdirectory(tinyxml ${TORQUE_LIB_TARG_DIRECTORY}/tinyxml EXCLUDE_FROM_ALL) +add_subdirectory(tinyxml2 ${TORQUE_LIB_TARG_DIRECTORY}/tinyxml2 EXCLUDE_FROM_ALL) add_subdirectory(opcode ${TORQUE_LIB_TARG_DIRECTORY}/opcode EXCLUDE_FROM_ALL) add_subdirectory(pcre ${TORQUE_LIB_TARG_DIRECTORY}/pcre EXCLUDE_FROM_ALL) diff --git a/Engine/lib/collada/CMakeLists.txt b/Engine/lib/collada/CMakeLists.txt index 4c9b9616d..533565457 100644 --- a/Engine/lib/collada/CMakeLists.txt +++ b/Engine/lib/collada/CMakeLists.txt @@ -4,4 +4,4 @@ file(GLOB COLLADA_SOURCES "src/1.4/dom/*.cpp" "src/dae/*.cpp" "src/modules/LIBXM add_library(collada STATIC ${COLLADA_SOURCES}) target_include_directories(collada PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include/1.4) target_compile_definitions(collada PUBLIC DOM_INCLUDE_TINYXML PCRE_STATIC) -target_link_libraries(collada PUBLIC tinyxml pcre) +target_link_libraries(collada PUBLIC tinyxml2 pcre) diff --git a/Engine/lib/tinyxml/CMakeLists.txt b/Engine/lib/tinyxml/CMakeLists.txt deleted file mode 100644 index 83ac40ea3..000000000 --- a/Engine/lib/tinyxml/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_library(tinyxml STATIC "tinyxml2.cpp") - -# NOTE: Some stuff include tinyxml by tinyxml/tinyxml2.h instead of just tinyxml2.h -target_include_directories(tinyxml PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../) diff --git a/Engine/lib/tinyxml/docs/classtinyxml2_1_1_x_m_l_attribute.html b/Engine/lib/tinyxml/docs/classtinyxml2_1_1_x_m_l_attribute.html deleted file mode 100644 index bcec9428d..000000000 --- a/Engine/lib/tinyxml/docs/classtinyxml2_1_1_x_m_l_attribute.html +++ /dev/null @@ -1,232 +0,0 @@ - - -
- - - - -|
- TinyXML-2
- 9.0.0
-
- |
-
#include <tinyxml2.h>
-Public Member Functions | |
| -const char * | Name () const |
| The name of the attribute. | |
| -const char * | Value () const |
| The value of the attribute. | |
| -int | GetLineNum () const |
| Gets the line number the attribute is in, if the document was parsed from a file. | |
| -const XMLAttribute * | Next () const |
| The next attribute in the list. | |
| int | IntValue () const |
| -unsigned | UnsignedValue () const |
| Query as an unsigned integer. See IntValue() | |
| -bool | BoolValue () const |
| Query as a boolean. See IntValue() | |
| -double | DoubleValue () const |
| Query as a double. See IntValue() | |
| -float | FloatValue () const |
| Query as a float. See IntValue() | |
| XMLError | QueryIntValue (int *value) const |
| -XMLError | QueryUnsignedValue (unsigned int *value) const |
| See QueryIntValue. | |
| -XMLError | QueryInt64Value (int64_t *value) const |
| See QueryIntValue. | |
| -XMLError | QueryUnsigned64Value (uint64_t *value) const |
| See QueryIntValue. | |
| -XMLError | QueryBoolValue (bool *value) const |
| See QueryIntValue. | |
| -XMLError | QueryDoubleValue (double *value) const |
| See QueryIntValue. | |
| -XMLError | QueryFloatValue (float *value) const |
| See QueryIntValue. | |
| -void | SetAttribute (const char *value) |
| Set the attribute to a string value. | |
| -void | SetAttribute (int value) |
| Set the attribute to value. | |
| -void | SetAttribute (unsigned value) |
| Set the attribute to value. | |
| -void | SetAttribute (int64_t value) |
| Set the attribute to value. | |
| -void | SetAttribute (uint64_t value) |
| Set the attribute to value. | |
| -void | SetAttribute (bool value) |
| Set the attribute to value. | |
| -void | SetAttribute (double value) |
| Set the attribute to value. | |
| -void | SetAttribute (float value) |
| Set the attribute to value. | |
An attribute is a name-value pair. Elements have an arbitrary number of attributes, each with a unique name.
-
-
|
- -inline | -
IntValue interprets the attribute as an integer, and returns the value. If the value isn't an integer, 0 will be returned. There is no error checking; use QueryIntValue() if you need error checking.
- -| XMLError tinyxml2::XMLAttribute::QueryIntValue | -( | -int * | -value | ) | -const | -
QueryIntValue interprets the attribute as an integer, and returns the value in the provided parameter. The function will return XML_SUCCESS on success, and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.
- -|
- TinyXML-2
- 9.0.0
-
- |
-
This is the complete list of members for tinyxml2::XMLComment, including all inherited members.
-|
- TinyXML-2
- 9.0.0
-
- |
-
#include <tinyxml2.h>
-
--Public Member Functions | |
| -virtual XMLComment * | ToComment () |
| Safely cast to a Comment, or null. | |
| virtual bool | Accept (XMLVisitor *visitor) const |
| virtual XMLNode * | ShallowClone (XMLDocument *document) const |
| virtual bool | ShallowEqual (const XMLNode *compare) const |
Public Member Functions inherited from tinyxml2::XMLNode | |
| -const XMLDocument * | GetDocument () const |
| Get the XMLDocument that owns this XMLNode. | |
| -XMLDocument * | GetDocument () |
| Get the XMLDocument that owns this XMLNode. | |
| -virtual XMLElement * | ToElement () |
| Safely cast to an Element, or null. | |
| -virtual XMLText * | ToText () |
| Safely cast to Text, or null. | |
| -virtual XMLDocument * | ToDocument () |
| Safely cast to a Document, or null. | |
| -virtual XMLDeclaration * | ToDeclaration () |
| Safely cast to a Declaration, or null. | |
| -virtual XMLUnknown * | ToUnknown () |
| Safely cast to an Unknown, or null. | |
| const char * | Value () const |
| void | SetValue (const char *val, bool staticMem=false) |
| -int | GetLineNum () const |
| Gets the line number the node is in, if the document was parsed from a file. | |
| -const XMLNode * | Parent () const |
| Get the parent of this node on the DOM. | |
| -bool | NoChildren () const |
| Returns true if this node has no children. | |
| -const XMLNode * | FirstChild () const |
| Get the first child node, or null if none exists. | |
| const XMLElement * | FirstChildElement (const char *name=0) const |
| -const XMLNode * | LastChild () const |
| Get the last child node, or null if none exists. | |
| const XMLElement * | LastChildElement (const char *name=0) const |
| -const XMLNode * | PreviousSibling () const |
| Get the previous (left) sibling node of this node. | |
| -const XMLElement * | PreviousSiblingElement (const char *name=0) const |
| Get the previous (left) sibling element of this node, with an optionally supplied name. | |
| -const XMLNode * | NextSibling () const |
| Get the next (right) sibling node of this node. | |
| -const XMLElement * | NextSiblingElement (const char *name=0) const |
| Get the next (right) sibling element of this node, with an optionally supplied name. | |
| XMLNode * | InsertEndChild (XMLNode *addThis) |
| XMLNode * | InsertFirstChild (XMLNode *addThis) |
| XMLNode * | InsertAfterChild (XMLNode *afterThis, XMLNode *addThis) |
| void | DeleteChildren () |
| void | DeleteChild (XMLNode *node) |
| XMLNode * | DeepClone (XMLDocument *target) const |
| void | SetUserData (void *userData) |
| void * | GetUserData () const |
An XML Comment.
-
-
|
- -virtual | -
Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the XMLVisitor interface.
-This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this interface versus any other.)
-The interface has been based on ideas from:
- -Which are both good references for "visiting".
-An example of using Accept():
XMLPrinter printer; -tinyxmlDoc.Accept( &printer ); -const char* xmlcstr = printer.CStr(); --
Implements tinyxml2::XMLNode.
- -
-
|
- -virtual | -
Make a copy of this node, but not its children. You may pass in a Document pointer that will be the owner of the new Node. If the 'document' is null, then the node returned will be allocated from the current Document. (this->GetDocument())
-Note: if called on a XMLDocument, this will return null.
- -Implements tinyxml2::XMLNode.
- -
-
|
- -virtual | -
Test if 2 nodes are the same, but don't test children. The 2 nodes do not need to be in the same Document.
-Note: if called on a XMLDocument, this will return false.
- -Implements tinyxml2::XMLNode.
- -|
- TinyXML-2
- 9.0.0
-
- |
-
This is the complete list of members for tinyxml2::XMLDeclaration, including all inherited members.
-|
- TinyXML-2
- 9.0.0
-
- |
-
#include <tinyxml2.h>
-
--Public Member Functions | |
| -virtual XMLDeclaration * | ToDeclaration () |
| Safely cast to a Declaration, or null. | |
| virtual bool | Accept (XMLVisitor *visitor) const |
| virtual XMLNode * | ShallowClone (XMLDocument *document) const |
| virtual bool | ShallowEqual (const XMLNode *compare) const |
Public Member Functions inherited from tinyxml2::XMLNode | |
| -const XMLDocument * | GetDocument () const |
| Get the XMLDocument that owns this XMLNode. | |
| -XMLDocument * | GetDocument () |
| Get the XMLDocument that owns this XMLNode. | |
| -virtual XMLElement * | ToElement () |
| Safely cast to an Element, or null. | |
| -virtual XMLText * | ToText () |
| Safely cast to Text, or null. | |
| -virtual XMLComment * | ToComment () |
| Safely cast to a Comment, or null. | |
| -virtual XMLDocument * | ToDocument () |
| Safely cast to a Document, or null. | |
| -virtual XMLUnknown * | ToUnknown () |
| Safely cast to an Unknown, or null. | |
| const char * | Value () const |
| void | SetValue (const char *val, bool staticMem=false) |
| -int | GetLineNum () const |
| Gets the line number the node is in, if the document was parsed from a file. | |
| -const XMLNode * | Parent () const |
| Get the parent of this node on the DOM. | |
| -bool | NoChildren () const |
| Returns true if this node has no children. | |
| -const XMLNode * | FirstChild () const |
| Get the first child node, or null if none exists. | |
| const XMLElement * | FirstChildElement (const char *name=0) const |
| -const XMLNode * | LastChild () const |
| Get the last child node, or null if none exists. | |
| const XMLElement * | LastChildElement (const char *name=0) const |
| -const XMLNode * | PreviousSibling () const |
| Get the previous (left) sibling node of this node. | |
| -const XMLElement * | PreviousSiblingElement (const char *name=0) const |
| Get the previous (left) sibling element of this node, with an optionally supplied name. | |
| -const XMLNode * | NextSibling () const |
| Get the next (right) sibling node of this node. | |
| -const XMLElement * | NextSiblingElement (const char *name=0) const |
| Get the next (right) sibling element of this node, with an optionally supplied name. | |
| XMLNode * | InsertEndChild (XMLNode *addThis) |
| XMLNode * | InsertFirstChild (XMLNode *addThis) |
| XMLNode * | InsertAfterChild (XMLNode *afterThis, XMLNode *addThis) |
| void | DeleteChildren () |
| void | DeleteChild (XMLNode *node) |
| XMLNode * | DeepClone (XMLDocument *target) const |
| void | SetUserData (void *userData) |
| void * | GetUserData () const |
In correct XML the declaration is the first entry in the file.
<?xml version="1.0" standalone="yes"?> -
TinyXML-2 will happily read or write files without a declaration, however.
-The text of the declaration isn't interpreted. It is parsed and written as a string.
-
-
|
- -virtual | -
Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the XMLVisitor interface.
-This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this interface versus any other.)
-The interface has been based on ideas from:
- -Which are both good references for "visiting".
-An example of using Accept():
XMLPrinter printer; -tinyxmlDoc.Accept( &printer ); -const char* xmlcstr = printer.CStr(); --
Implements tinyxml2::XMLNode.
- -
-
|
- -virtual | -
Make a copy of this node, but not its children. You may pass in a Document pointer that will be the owner of the new Node. If the 'document' is null, then the node returned will be allocated from the current Document. (this->GetDocument())
-Note: if called on a XMLDocument, this will return null.
- -Implements tinyxml2::XMLNode.
- -
-
|
- -virtual | -
Test if 2 nodes are the same, but don't test children. The 2 nodes do not need to be in the same Document.
-Note: if called on a XMLDocument, this will return false.
- -Implements tinyxml2::XMLNode.
- -|
- TinyXML-2
- 9.0.0
-
- |
-
This is the complete list of members for tinyxml2::XMLDocument, including all inherited members.
-|
- TinyXML-2
- 9.0.0
-
- |
-
#include <tinyxml2.h>
-
--Public Member Functions | |
| - | XMLDocument (bool processEntities=true, Whitespace whitespaceMode=PRESERVE_WHITESPACE) |
| constructor | |
| -virtual XMLDocument * | ToDocument () |
| Safely cast to a Document, or null. | |
| XMLError | Parse (const char *xml, size_t nBytes=static_cast< size_t >(-1)) |
| XMLError | LoadFile (const char *filename) |
| XMLError | LoadFile (FILE *) |
| XMLError | SaveFile (const char *filename, bool compact=false) |
| XMLError | SaveFile (FILE *fp, bool compact=false) |
| bool | HasBOM () const |
| void | SetBOM (bool useBOM) |
| XMLElement * | RootElement () |
| void | Print (XMLPrinter *streamer=0) const |
| virtual bool | Accept (XMLVisitor *visitor) const |
| XMLElement * | NewElement (const char *name) |
| XMLComment * | NewComment (const char *comment) |
| XMLText * | NewText (const char *text) |
| XMLDeclaration * | NewDeclaration (const char *text=0) |
| XMLUnknown * | NewUnknown (const char *text) |
| void | DeleteNode (XMLNode *node) |
| -void | ClearError () |
| Clears the error flags. | |
| -bool | Error () const |
| Return true if there was an error parsing the document. | |
| -XMLError | ErrorID () const |
| Return the errorID. | |
| const char * | ErrorStr () const |
| -void | PrintError () const |
| A (trivial) utility function that prints the ErrorStr() to stdout. | |
| -int | ErrorLineNum () const |
| Return the line where the error occurred, or zero if unknown. | |
| -void | Clear () |
| Clear the document, resetting it to the initial state. | |
| void | DeepCopy (XMLDocument *target) const |
| virtual XMLNode * | ShallowClone (XMLDocument *) const |
| virtual bool | ShallowEqual (const XMLNode *) const |
Public Member Functions inherited from tinyxml2::XMLNode | |
| -const XMLDocument * | GetDocument () const |
| Get the XMLDocument that owns this XMLNode. | |
| -XMLDocument * | GetDocument () |
| Get the XMLDocument that owns this XMLNode. | |
| -virtual XMLElement * | ToElement () |
| Safely cast to an Element, or null. | |
| -virtual XMLText * | ToText () |
| Safely cast to Text, or null. | |
| -virtual XMLComment * | ToComment () |
| Safely cast to a Comment, or null. | |
| -virtual XMLDeclaration * | ToDeclaration () |
| Safely cast to a Declaration, or null. | |
| -virtual XMLUnknown * | ToUnknown () |
| Safely cast to an Unknown, or null. | |
| const char * | Value () const |
| void | SetValue (const char *val, bool staticMem=false) |
| -int | GetLineNum () const |
| Gets the line number the node is in, if the document was parsed from a file. | |
| -const XMLNode * | Parent () const |
| Get the parent of this node on the DOM. | |
| -bool | NoChildren () const |
| Returns true if this node has no children. | |
| -const XMLNode * | FirstChild () const |
| Get the first child node, or null if none exists. | |
| const XMLElement * | FirstChildElement (const char *name=0) const |
| -const XMLNode * | LastChild () const |
| Get the last child node, or null if none exists. | |
| const XMLElement * | LastChildElement (const char *name=0) const |
| -const XMLNode * | PreviousSibling () const |
| Get the previous (left) sibling node of this node. | |
| -const XMLElement * | PreviousSiblingElement (const char *name=0) const |
| Get the previous (left) sibling element of this node, with an optionally supplied name. | |
| -const XMLNode * | NextSibling () const |
| Get the next (right) sibling node of this node. | |
| -const XMLElement * | NextSiblingElement (const char *name=0) const |
| Get the next (right) sibling element of this node, with an optionally supplied name. | |
| XMLNode * | InsertEndChild (XMLNode *addThis) |
| XMLNode * | InsertFirstChild (XMLNode *addThis) |
| XMLNode * | InsertAfterChild (XMLNode *afterThis, XMLNode *addThis) |
| void | DeleteChildren () |
| void | DeleteChild (XMLNode *node) |
| XMLNode * | DeepClone (XMLDocument *target) const |
| void | SetUserData (void *userData) |
| void * | GetUserData () const |
A Document binds together all the functionality. It can be saved, loaded, and printed to the screen. All Nodes are connected and allocated to a Document. If the Document is deleted, all its Nodes are also deleted.
-
-
|
- -virtual | -
Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the XMLVisitor interface.
-This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this interface versus any other.)
-The interface has been based on ideas from:
- -Which are both good references for "visiting".
-An example of using Accept():
XMLPrinter printer; -tinyxmlDoc.Accept( &printer ); -const char* xmlcstr = printer.CStr(); --
Implements tinyxml2::XMLNode.
- -| void tinyxml2::XMLDocument::DeepCopy | -( | -XMLDocument * | -target | ) | -const | -
Copies this document to a target document. The target will be completely cleared before the copy. If you want to copy a sub-tree, see XMLNode::DeepClone().
-NOTE: that the 'target' must be non-null.
- -| void tinyxml2::XMLDocument::DeleteNode | -( | -XMLNode * | -node | ) | -- |
Delete a node associated with this document. It will be unlinked from the DOM.
- -| const char* tinyxml2::XMLDocument::ErrorStr | -( | -) | -const | -
Returns a "long form" error description. A hopefully helpful diagnostic with location, line number, and/or additional info.
- -
-
|
- -inline | -
Returns true if this document has a leading Byte Order Mark of UTF8.
- -| XMLError tinyxml2::XMLDocument::LoadFile | -( | -const char * | -filename | ) | -- |
Load an XML file from disk. Returns XML_SUCCESS (0) on success, or an errorID.
- -| XMLError tinyxml2::XMLDocument::LoadFile | -( | -FILE * | -) | -- |
Load an XML file from disk. You are responsible for providing and closing the FILE*.
-NOTE: The file should be opened as binary ("rb") not text in order for TinyXML-2 to correctly do newline normalization.
-Returns XML_SUCCESS (0) on success, or an errorID.
- -| XMLComment* tinyxml2::XMLDocument::NewComment | -( | -const char * | -comment | ) | -- |
Create a new Comment associated with this Document. The memory for the Comment is managed by the Document.
- -| XMLDeclaration* tinyxml2::XMLDocument::NewDeclaration | -( | -const char * | -text = 0 | ) | -- |
Create a new Declaration associated with this Document. The memory for the object is managed by the Document.
-If the 'text' param is null, the standard declaration is used.:
<?xml version="1.0" encoding="UTF-8"?> --
| XMLElement* tinyxml2::XMLDocument::NewElement | -( | -const char * | -name | ) | -- |
Create a new Element associated with this Document. The memory for the Element is managed by the Document.
- -| XMLText* tinyxml2::XMLDocument::NewText | -( | -const char * | -text | ) | -- |
Create a new Text associated with this Document. The memory for the Text is managed by the Document.
- -| XMLUnknown* tinyxml2::XMLDocument::NewUnknown | -( | -const char * | -text | ) | -- |
Create a new Unknown associated with this Document. The memory for the object is managed by the Document.
- -| XMLError tinyxml2::XMLDocument::Parse | -( | -const char * | -xml, | -
| - | - | size_t | -nBytes = static_cast< size_t >(-1) |
-
| - | ) | -- |
Parse an XML file from a character string. Returns XML_SUCCESS (0) on success, or an errorID.
-You may optionally pass in the 'nBytes', which is the number of bytes which will be parsed. If not specified, TinyXML-2 will assume 'xml' points to a null terminated string.
- -| void tinyxml2::XMLDocument::Print | -( | -XMLPrinter * | -streamer = 0 | ) | -const | -
Print the Document. If the Printer is not provided, it will print to stdout. If you provide Printer, this can print to a file:
XMLPrinter printer( fp ); -doc.Print( &printer ); -
Or you can use a printer to print to memory:
XMLPrinter printer; -doc.Print( &printer ); -// printer.CStr() has a const char* to the XML --
-
|
- -inline | -
Return the root element of DOM. Equivalent to FirstChildElement(). To get the first node, use FirstChild().
- -| XMLError tinyxml2::XMLDocument::SaveFile | -( | -const char * | -filename, | -
| - | - | bool | -compact = false |
-
| - | ) | -- |
Save the XML file to disk. Returns XML_SUCCESS (0) on success, or an errorID.
- -| XMLError tinyxml2::XMLDocument::SaveFile | -( | -FILE * | -fp, | -
| - | - | bool | -compact = false |
-
| - | ) | -- |
Save the XML file to disk. You are responsible for providing and closing the FILE*.
-Returns XML_SUCCESS (0) on success, or an errorID.
- -
-
|
- -inline | -
Sets whether to write the BOM when writing the file.
- -
-
|
- -inlinevirtual | -
Make a copy of this node, but not its children. You may pass in a Document pointer that will be the owner of the new Node. If the 'document' is null, then the node returned will be allocated from the current Document. (this->GetDocument())
-Note: if called on a XMLDocument, this will return null.
- -Implements tinyxml2::XMLNode.
- -
-
|
- -inlinevirtual | -
Test if 2 nodes are the same, but don't test children. The 2 nodes do not need to be in the same Document.
-Note: if called on a XMLDocument, this will return false.
- -Implements tinyxml2::XMLNode.
- -|
- TinyXML-2
- 9.0.0
-
- |
-
#include <tinyxml2.h>
-
--Public Member Functions | |
| -const char * | Name () const |
| Get the name of an element (which is the Value() of the node.) | |
| -void | SetName (const char *str, bool staticMem=false) |
| Set the name of the element. | |
| -virtual XMLElement * | ToElement () |
| Safely cast to an Element, or null. | |
| virtual bool | Accept (XMLVisitor *visitor) const |
| const char * | Attribute (const char *name, const char *value=0) const |
| int | IntAttribute (const char *name, int defaultValue=0) const |
| -unsigned | UnsignedAttribute (const char *name, unsigned defaultValue=0) const |
| See IntAttribute() | |
| -int64_t | Int64Attribute (const char *name, int64_t defaultValue=0) const |
| See IntAttribute() | |
| -uint64_t | Unsigned64Attribute (const char *name, uint64_t defaultValue=0) const |
| See IntAttribute() | |
| -bool | BoolAttribute (const char *name, bool defaultValue=false) const |
| See IntAttribute() | |
| -double | DoubleAttribute (const char *name, double defaultValue=0) const |
| See IntAttribute() | |
| -float | FloatAttribute (const char *name, float defaultValue=0) const |
| See IntAttribute() | |
| XMLError | QueryIntAttribute (const char *name, int *value) const |
| -XMLError | QueryUnsignedAttribute (const char *name, unsigned int *value) const |
| See QueryIntAttribute() | |
| -XMLError | QueryInt64Attribute (const char *name, int64_t *value) const |
| See QueryIntAttribute() | |
| -XMLError | QueryUnsigned64Attribute (const char *name, uint64_t *value) const |
| See QueryIntAttribute() | |
| -XMLError | QueryBoolAttribute (const char *name, bool *value) const |
| See QueryIntAttribute() | |
| -XMLError | QueryDoubleAttribute (const char *name, double *value) const |
| See QueryIntAttribute() | |
| -XMLError | QueryFloatAttribute (const char *name, float *value) const |
| See QueryIntAttribute() | |
| -XMLError | QueryStringAttribute (const char *name, const char **value) const |
| See QueryIntAttribute() | |
| XMLError | QueryAttribute (const char *name, int *value) const |
| -void | SetAttribute (const char *name, const char *value) |
| Sets the named attribute to value. | |
| -void | SetAttribute (const char *name, int value) |
| Sets the named attribute to value. | |
| -void | SetAttribute (const char *name, unsigned value) |
| Sets the named attribute to value. | |
| -void | SetAttribute (const char *name, int64_t value) |
| Sets the named attribute to value. | |
| -void | SetAttribute (const char *name, uint64_t value) |
| Sets the named attribute to value. | |
| -void | SetAttribute (const char *name, bool value) |
| Sets the named attribute to value. | |
| -void | SetAttribute (const char *name, double value) |
| Sets the named attribute to value. | |
| -void | SetAttribute (const char *name, float value) |
| Sets the named attribute to value. | |
| void | DeleteAttribute (const char *name) |
| -const XMLAttribute * | FirstAttribute () const |
| Return the first attribute in the list. | |
| -const XMLAttribute * | FindAttribute (const char *name) const |
| Query a specific attribute in the list. | |
| const char * | GetText () const |
| void | SetText (const char *inText) |
| -void | SetText (int value) |
| Convenience method for setting text inside an element. See SetText() for important limitations. | |
| -void | SetText (unsigned value) |
| Convenience method for setting text inside an element. See SetText() for important limitations. | |
| -void | SetText (int64_t value) |
| Convenience method for setting text inside an element. See SetText() for important limitations. | |
| -void | SetText (uint64_t value) |
| Convenience method for setting text inside an element. See SetText() for important limitations. | |
| -void | SetText (bool value) |
| Convenience method for setting text inside an element. See SetText() for important limitations. | |
| -void | SetText (double value) |
| Convenience method for setting text inside an element. See SetText() for important limitations. | |
| -void | SetText (float value) |
| Convenience method for setting text inside an element. See SetText() for important limitations. | |
| XMLError | QueryIntText (int *ival) const |
| -XMLError | QueryUnsignedText (unsigned *uval) const |
| See QueryIntText() | |
| -XMLError | QueryInt64Text (int64_t *uval) const |
| See QueryIntText() | |
| -XMLError | QueryUnsigned64Text (uint64_t *uval) const |
| See QueryIntText() | |
| -XMLError | QueryBoolText (bool *bval) const |
| See QueryIntText() | |
| -XMLError | QueryDoubleText (double *dval) const |
| See QueryIntText() | |
| -XMLError | QueryFloatText (float *fval) const |
| See QueryIntText() | |
| -unsigned | UnsignedText (unsigned defaultValue=0) const |
| See QueryIntText() | |
| -int64_t | Int64Text (int64_t defaultValue=0) const |
| See QueryIntText() | |
| -uint64_t | Unsigned64Text (uint64_t defaultValue=0) const |
| See QueryIntText() | |
| -bool | BoolText (bool defaultValue=false) const |
| See QueryIntText() | |
| -double | DoubleText (double defaultValue=0) const |
| See QueryIntText() | |
| -float | FloatText (float defaultValue=0) const |
| See QueryIntText() | |
| XMLElement * | InsertNewChildElement (const char *name) |
| -XMLComment * | InsertNewComment (const char *comment) |
| See InsertNewChildElement() | |
| -XMLText * | InsertNewText (const char *text) |
| See InsertNewChildElement() | |
| -XMLDeclaration * | InsertNewDeclaration (const char *text) |
| See InsertNewChildElement() | |
| -XMLUnknown * | InsertNewUnknown (const char *text) |
| See InsertNewChildElement() | |
| virtual XMLNode * | ShallowClone (XMLDocument *document) const |
| virtual bool | ShallowEqual (const XMLNode *compare) const |
Public Member Functions inherited from tinyxml2::XMLNode | |
| -const XMLDocument * | GetDocument () const |
| Get the XMLDocument that owns this XMLNode. | |
| -XMLDocument * | GetDocument () |
| Get the XMLDocument that owns this XMLNode. | |
| -virtual XMLText * | ToText () |
| Safely cast to Text, or null. | |
| -virtual XMLComment * | ToComment () |
| Safely cast to a Comment, or null. | |
| -virtual XMLDocument * | ToDocument () |
| Safely cast to a Document, or null. | |
| -virtual XMLDeclaration * | ToDeclaration () |
| Safely cast to a Declaration, or null. | |
| -virtual XMLUnknown * | ToUnknown () |
| Safely cast to an Unknown, or null. | |
| const char * | Value () const |
| void | SetValue (const char *val, bool staticMem=false) |
| -int | GetLineNum () const |
| Gets the line number the node is in, if the document was parsed from a file. | |
| -const XMLNode * | Parent () const |
| Get the parent of this node on the DOM. | |
| -bool | NoChildren () const |
| Returns true if this node has no children. | |
| -const XMLNode * | FirstChild () const |
| Get the first child node, or null if none exists. | |
| const XMLElement * | FirstChildElement (const char *name=0) const |
| -const XMLNode * | LastChild () const |
| Get the last child node, or null if none exists. | |
| const XMLElement * | LastChildElement (const char *name=0) const |
| -const XMLNode * | PreviousSibling () const |
| Get the previous (left) sibling node of this node. | |
| -const XMLElement * | PreviousSiblingElement (const char *name=0) const |
| Get the previous (left) sibling element of this node, with an optionally supplied name. | |
| -const XMLNode * | NextSibling () const |
| Get the next (right) sibling node of this node. | |
| -const XMLElement * | NextSiblingElement (const char *name=0) const |
| Get the next (right) sibling element of this node, with an optionally supplied name. | |
| XMLNode * | InsertEndChild (XMLNode *addThis) |
| XMLNode * | InsertFirstChild (XMLNode *addThis) |
| XMLNode * | InsertAfterChild (XMLNode *afterThis, XMLNode *addThis) |
| void | DeleteChildren () |
| void | DeleteChild (XMLNode *node) |
| XMLNode * | DeepClone (XMLDocument *target) const |
| void | SetUserData (void *userData) |
| void * | GetUserData () const |
The element is a container class. It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes.
-
-
|
- -virtual | -
Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the XMLVisitor interface.
-This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this interface versus any other.)
-The interface has been based on ideas from:
- -Which are both good references for "visiting".
-An example of using Accept():
XMLPrinter printer; -tinyxmlDoc.Accept( &printer ); -const char* xmlcstr = printer.CStr(); --
Implements tinyxml2::XMLNode.
- -| const char* tinyxml2::XMLElement::Attribute | -( | -const char * | -name, | -
| - | - | const char * | -value = 0 |
-
| - | ) | -const | -
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. For example:
-const char* value = ele->Attribute( "foo" ); -
The 'value' parameter is normally null. However, if specified, the attribute will only be returned if the 'name' and 'value' match. This allow you to write code:
-if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar(); -
rather than:
if ( ele->Attribute( "foo" ) ) {
- if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar();
-}
-
-| void tinyxml2::XMLElement::DeleteAttribute | -( | -const char * | -name | ) | -- |
Delete an attribute.
- -| const char* tinyxml2::XMLElement::GetText | -( | -) | -const | -
Convenience function for easy access to the text inside an element. Although easy and concise, GetText() is limited compared to getting the XMLText child and accessing it directly.
-If the first child of 'this' is a XMLText, the GetText() returns the character string of the Text node, else null is returned.
-This is a convenient method for getting the text of simple contained text:
<foo>This is text</foo> - const char* str = fooElement->GetText(); -
'str' will be a pointer to "This is text".
-Note that this function can be misleading. If the element foo was created from this XML:
<foo><b>This is text</b></foo> -
then the value of str would be null. The first child node isn't a text node, it is another element. From this XML:
<foo>This is <b>text</b></foo> -
GetText() will return "This is ".
- -| XMLElement* tinyxml2::XMLElement::InsertNewChildElement | -( | -const char * | -name | ) | -- |
Convenience method to create a new XMLElement and add it as last (right) child of this node. Returns the created and inserted element.
- -| int tinyxml2::XMLElement::IntAttribute | -( | -const char * | -name, | -
| - | - | int | -defaultValue = 0 |
-
| - | ) | -const | -
Given an attribute name, IntAttribute() returns the value of the attribute interpreted as an integer. The default value will be returned if the attribute isn't present, or if there is an error. (For a method with error checking, see QueryIntAttribute()).
- -
-
|
- -inline | -
Given an attribute name, QueryAttribute() returns XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion can't be performed, or XML_NO_ATTRIBUTE if the attribute doesn't exist. It is overloaded for the primitive types, and is a generally more convenient replacement of QueryIntAttribute() and related functions.
-If successful, the result of the conversion will be written to 'value'. If not successful, nothing will be written to 'value'. This allows you to provide default value:
-int value = 10; -QueryAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 --
-
|
- -inline | -
Given an attribute name, QueryIntAttribute() returns XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion can't be performed, or XML_NO_ATTRIBUTE if the attribute doesn't exist. If successful, the result of the conversion will be written to 'value'. If not successful, nothing will be written to 'value'. This allows you to provide default value:
-int value = 10; -QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 --
| XMLError tinyxml2::XMLElement::QueryIntText | -( | -int * | -ival | ) | -const | -
Convenience method to query the value of a child text node. This is probably best shown by example. Given you have a document is this form:
<point> - <x>1</x> - <y>1.4</y> - </point> -
The QueryIntText() and similar functions provide a safe and easier way to get to the "value" of x and y.
-int x = 0; - float y = 0; // types of x and y are contrived for example - const XMLElement* xElement = pointElement->FirstChildElement( "x" ); - const XMLElement* yElement = pointElement->FirstChildElement( "y" ); - xElement->QueryIntText( &x ); - yElement->QueryFloatText( &y ); -
| void tinyxml2::XMLElement::SetText | -( | -const char * | -inText | ) | -- |
Convenience function for easy access to the text inside an element. Although easy and concise, SetText() is limited compared to creating an XMLText child and mutating it directly.
-If the first child of 'this' is a XMLText, SetText() sets its value to the given string, otherwise it will create a first child that is an XMLText.
-This is a convenient method for setting the text of simple contained text:
<foo>This is text</foo> - fooElement->SetText( "Hullaballoo!" ); -<foo>Hullaballoo!</foo> -
Note that this function can be misleading. If the element foo was created from this XML:
<foo><b>This is text</b></foo> -
then it will not change "This is text", but rather prefix it with a text element:
<foo>Hullaballoo!<b>This is text</b></foo> -
For this XML:
<foo /> -
SetText() will generate
<foo>Hullaballoo!</foo> --
-
|
- -virtual | -
Make a copy of this node, but not its children. You may pass in a Document pointer that will be the owner of the new Node. If the 'document' is null, then the node returned will be allocated from the current Document. (this->GetDocument())
-Note: if called on a XMLDocument, this will return null.
- -Implements tinyxml2::XMLNode.
- -
-
|
- -virtual | -
Test if 2 nodes are the same, but don't test children. The 2 nodes do not need to be in the same Document.
-Note: if called on a XMLDocument, this will return false.
- -Implements tinyxml2::XMLNode.
- -|
- TinyXML-2
- 9.0.0
-
- |
-
This is the complete list of members for tinyxml2::XMLNode, including all inherited members.
-|
- TinyXML-2
- 9.0.0
-
- |
-
#include <tinyxml2.h>
-
--Public Member Functions | |
| -const XMLDocument * | GetDocument () const |
| Get the XMLDocument that owns this XMLNode. | |
| -XMLDocument * | GetDocument () |
| Get the XMLDocument that owns this XMLNode. | |
| -virtual XMLElement * | ToElement () |
| Safely cast to an Element, or null. | |
| -virtual XMLText * | ToText () |
| Safely cast to Text, or null. | |
| -virtual XMLComment * | ToComment () |
| Safely cast to a Comment, or null. | |
| -virtual XMLDocument * | ToDocument () |
| Safely cast to a Document, or null. | |
| -virtual XMLDeclaration * | ToDeclaration () |
| Safely cast to a Declaration, or null. | |
| -virtual XMLUnknown * | ToUnknown () |
| Safely cast to an Unknown, or null. | |
| const char * | Value () const |
| void | SetValue (const char *val, bool staticMem=false) |
| -int | GetLineNum () const |
| Gets the line number the node is in, if the document was parsed from a file. | |
| -const XMLNode * | Parent () const |
| Get the parent of this node on the DOM. | |
| -bool | NoChildren () const |
| Returns true if this node has no children. | |
| -const XMLNode * | FirstChild () const |
| Get the first child node, or null if none exists. | |
| const XMLElement * | FirstChildElement (const char *name=0) const |
| -const XMLNode * | LastChild () const |
| Get the last child node, or null if none exists. | |
| const XMLElement * | LastChildElement (const char *name=0) const |
| -const XMLNode * | PreviousSibling () const |
| Get the previous (left) sibling node of this node. | |
| -const XMLElement * | PreviousSiblingElement (const char *name=0) const |
| Get the previous (left) sibling element of this node, with an optionally supplied name. | |
| -const XMLNode * | NextSibling () const |
| Get the next (right) sibling node of this node. | |
| -const XMLElement * | NextSiblingElement (const char *name=0) const |
| Get the next (right) sibling element of this node, with an optionally supplied name. | |
| XMLNode * | InsertEndChild (XMLNode *addThis) |
| XMLNode * | InsertFirstChild (XMLNode *addThis) |
| XMLNode * | InsertAfterChild (XMLNode *afterThis, XMLNode *addThis) |
| void | DeleteChildren () |
| void | DeleteChild (XMLNode *node) |
| virtual XMLNode * | ShallowClone (XMLDocument *document) const =0 |
| XMLNode * | DeepClone (XMLDocument *target) const |
| virtual bool | ShallowEqual (const XMLNode *compare) const =0 |
| virtual bool | Accept (XMLVisitor *visitor) const =0 |
| void | SetUserData (void *userData) |
| void * | GetUserData () const |
XMLNode is a base class for every object that is in the XML Document Object Model (DOM), except XMLAttributes. Nodes have siblings, a parent, and children which can be navigated. A node is always in a XMLDocument. The type of a XMLNode can be queried, and it can be cast to its more defined type.
-A XMLDocument allocates memory for all its Nodes. When the XMLDocument gets deleted, all its Nodes will also be deleted.
-A Document can contain: Element (container or leaf) - Comment (leaf) - Unknown (leaf) - Declaration( leaf ) - -An Element can contain: Element (container or leaf) - Text (leaf) - Attributes (not on tree) - Comment (leaf) - Unknown (leaf)
-
|
- -pure virtual | -
Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the XMLVisitor interface.
-This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this interface versus any other.)
-The interface has been based on ideas from:
- -Which are both good references for "visiting".
-An example of using Accept():
XMLPrinter printer; -tinyxmlDoc.Accept( &printer ); -const char* xmlcstr = printer.CStr(); --
Implemented in tinyxml2::XMLDocument, tinyxml2::XMLElement, tinyxml2::XMLUnknown, tinyxml2::XMLDeclaration, tinyxml2::XMLComment, and tinyxml2::XMLText.
- -| XMLNode* tinyxml2::XMLNode::DeepClone | -( | -XMLDocument * | -target | ) | -const | -
Make a copy of this node and all its children.
-If the 'target' is null, then the nodes will be allocated in the current document. If 'target' is specified, the memory will be allocated is the specified XMLDocument.
-NOTE: This is probably not the correct tool to copy a document, since XMLDocuments can have multiple top level XMLNodes. You probably want to use XMLDocument::DeepCopy()
- -| void tinyxml2::XMLNode::DeleteChild | -( | -XMLNode * | -node | ) | -- |
Delete a child of this node.
- -| void tinyxml2::XMLNode::DeleteChildren | -( | -) | -- |
Delete all the children of this node.
- -| const XMLElement* tinyxml2::XMLNode::FirstChildElement | -( | -const char * | -name = 0 | ) | -const | -
Get the first child element, or optionally the first child element with the specified name.
- -
-
|
- -inline | -
Get user data set into the XMLNode. TinyXML-2 in no way processes or interprets user data. It is initially 0.
- -| XMLNode* tinyxml2::XMLNode::InsertAfterChild | -( | -XMLNode * | -afterThis, | -
| - | - | XMLNode * | -addThis | -
| - | ) | -- |
Add a node after the specified child node. If the child node is already part of the document, it is moved from its old location to the new location. Returns the addThis argument or 0 if the afterThis node is not a child of this node, or if the node does not belong to the same document.
- -Add a child node as the last (right) child. If the child node is already part of the document, it is moved from its old location to the new location. Returns the addThis argument or 0 if the node does not belong to the same document.
- -Add a child node as the first (left) child. If the child node is already part of the document, it is moved from its old location to the new location. Returns the addThis argument or 0 if the node does not belong to the same document.
- -| const XMLElement* tinyxml2::XMLNode::LastChildElement | -( | -const char * | -name = 0 | ) | -const | -
Get the last child element or optionally the last child element with the specified name.
- -
-
|
- -inline | -
Set user data into the XMLNode. TinyXML-2 in no way processes or interprets user data. It is initially 0.
- -| void tinyxml2::XMLNode::SetValue | -( | -const char * | -val, | -
| - | - | bool | -staticMem = false |
-
| - | ) | -- |
Set the Value of an XML node.
-
|
- -pure virtual | -
Make a copy of this node, but not its children. You may pass in a Document pointer that will be the owner of the new Node. If the 'document' is null, then the node returned will be allocated from the current Document. (this->GetDocument())
-Note: if called on a XMLDocument, this will return null.
- -Implemented in tinyxml2::XMLElement, tinyxml2::XMLUnknown, tinyxml2::XMLDeclaration, tinyxml2::XMLComment, tinyxml2::XMLText, and tinyxml2::XMLDocument.
- -
-
|
- -pure virtual | -
Test if 2 nodes are the same, but don't test children. The 2 nodes do not need to be in the same Document.
-Note: if called on a XMLDocument, this will return false.
- -Implemented in tinyxml2::XMLElement, tinyxml2::XMLUnknown, tinyxml2::XMLDeclaration, tinyxml2::XMLComment, tinyxml2::XMLText, and tinyxml2::XMLDocument.
- -| const char* tinyxml2::XMLNode::Value | -( | -) | -const | -
The meaning of 'value' changes for the specific type.
Document: empty (NULL is returned, not an empty string) -Element: name of the element -Comment: the comment text -Unknown: the tag contents -Text: the text string --
|
- TinyXML-2
- 9.0.0
-
- |
-
This is the complete list of members for tinyxml2::XMLPrinter, including all inherited members.
-| ClearBuffer(bool resetToFirstElement=true) | tinyxml2::XMLPrinter | inline |
| CloseElement(bool compactMode=false) | tinyxml2::XMLPrinter | virtual |
| CStr() const | tinyxml2::XMLPrinter | inline |
| CStrSize() const | tinyxml2::XMLPrinter | inline |
| OpenElement(const char *name, bool compactMode=false) | tinyxml2::XMLPrinter | |
| PrintSpace(int depth) | tinyxml2::XMLPrinter | protectedvirtual |
| PushAttribute(const char *name, const char *value) | tinyxml2::XMLPrinter | |
| PushComment(const char *comment) | tinyxml2::XMLPrinter | |
| PushHeader(bool writeBOM, bool writeDeclaration) | tinyxml2::XMLPrinter | |
| PushText(const char *text, bool cdata=false) | tinyxml2::XMLPrinter | |
| PushText(int value) | tinyxml2::XMLPrinter | |
| PushText(unsigned value) | tinyxml2::XMLPrinter | |
| PushText(int64_t value) | tinyxml2::XMLPrinter | |
| PushText(uint64_t value) | tinyxml2::XMLPrinter | |
| PushText(bool value) | tinyxml2::XMLPrinter | |
| PushText(float value) | tinyxml2::XMLPrinter | |
| PushText(double value) | tinyxml2::XMLPrinter | |
| Visit(const XMLText &text) | tinyxml2::XMLPrinter | virtual |
| Visit(const XMLComment &comment) | tinyxml2::XMLPrinter | virtual |
| Visit(const XMLDeclaration &declaration) | tinyxml2::XMLPrinter | virtual |
| Visit(const XMLUnknown &unknown) | tinyxml2::XMLPrinter | virtual |
| VisitEnter(const XMLDocument &) | tinyxml2::XMLPrinter | virtual |
| VisitEnter(const XMLElement &element, const XMLAttribute *attribute) | tinyxml2::XMLPrinter | virtual |
| VisitExit(const XMLDocument &) | tinyxml2::XMLPrinter | inlinevirtual |
| VisitExit(const XMLElement &element) | tinyxml2::XMLPrinter | virtual |
| XMLPrinter(FILE *file=0, bool compact=false, int depth=0) | tinyxml2::XMLPrinter |
|
- TinyXML-2
- 9.0.0
-
- |
-
#include <tinyxml2.h>
-
--Public Member Functions | |
| XMLPrinter (FILE *file=0, bool compact=false, int depth=0) | |
| void | PushHeader (bool writeBOM, bool writeDeclaration) |
| void | OpenElement (const char *name, bool compactMode=false) |
| -void | PushAttribute (const char *name, const char *value) |
| If streaming, add an attribute to an open element. | |
| -virtual void | CloseElement (bool compactMode=false) |
| If streaming, close the Element. | |
| -void | PushText (const char *text, bool cdata=false) |
| Add a text node. | |
| -void | PushText (int value) |
| Add a text node from an integer. | |
| -void | PushText (unsigned value) |
| Add a text node from an unsigned. | |
| -void | PushText (int64_t value) |
| Add a text node from a signed 64bit integer. | |
| -void | PushText (uint64_t value) |
| Add a text node from an unsigned 64bit integer. | |
| -void | PushText (bool value) |
| Add a text node from a bool. | |
| -void | PushText (float value) |
| Add a text node from a float. | |
| -void | PushText (double value) |
| Add a text node from a double. | |
| -void | PushComment (const char *comment) |
| Add a comment. | |
| -virtual bool | VisitEnter (const XMLDocument &) |
| Visit a document. | |
| -virtual bool | VisitExit (const XMLDocument &) |
| Visit a document. | |
| -virtual bool | VisitEnter (const XMLElement &element, const XMLAttribute *attribute) |
| Visit an element. | |
| -virtual bool | VisitExit (const XMLElement &element) |
| Visit an element. | |
| -virtual bool | Visit (const XMLText &text) |
| Visit a text node. | |
| -virtual bool | Visit (const XMLComment &comment) |
| Visit a comment node. | |
| -virtual bool | Visit (const XMLDeclaration &declaration) |
| Visit a declaration. | |
| -virtual bool | Visit (const XMLUnknown &unknown) |
| Visit an unknown node. | |
| const char * | CStr () const |
| int | CStrSize () const |
| void | ClearBuffer (bool resetToFirstElement=true) |
-Protected Member Functions | |
| virtual void | PrintSpace (int depth) |
Printing functionality. The XMLPrinter gives you more options than the XMLDocument::Print() method.
-It can:
Print to Memory
-XMLPrinter printer; -doc.Print( &printer ); -SomeFunction( printer.CStr() ); -
Print to a File
-You provide the file pointer.
XMLPrinter printer( fp ); -doc.Print( &printer ); -
Print without a XMLDocument
-When loading, an XML parser is very useful. However, sometimes when saving, it just gets in the way. The code is often set up for streaming, and constructing the DOM is just overhead.
-The Printer supports the streaming case. The following code prints out a trivially simple XML file without ever creating an XML document.
-XMLPrinter printer( fp ); -printer.OpenElement( "foo" ); -printer.PushAttribute( "foo", "bar" ); -printer.CloseElement(); -
| tinyxml2::XMLPrinter::XMLPrinter | -( | -FILE * | -file = 0, |
-
| - | - | bool | -compact = false, |
-
| - | - | int | -depth = 0 |
-
| - | ) | -- |
Construct the printer. If the FILE* is specified, this will print to the FILE. Else it will print to memory, and the result is available in CStr(). If 'compact' is set to true, then output is created with only required whitespace and newlines.
- -
-
|
- -inline | -
If in print to memory mode, reset the buffer to the beginning.
- -
-
|
- -inline | -
If in print to memory mode, return a pointer to the XML file in memory.
- -
-
|
- -inline | -
If in print to memory mode, return the size of the XML file in memory. (Note the size returned includes the terminating null.)
- -| void tinyxml2::XMLPrinter::OpenElement | -( | -const char * | -name, | -
| - | - | bool | -compactMode = false |
-
| - | ) | -- |
If streaming, start writing an element. The element must be closed with CloseElement()
- -
-
|
- -protectedvirtual | -
Prints out the space before an element. You may override to change the space and tabs used. A PrintSpace() override should call Print().
- -| void tinyxml2::XMLPrinter::PushHeader | -( | -bool | -writeBOM, | -
| - | - | bool | -writeDeclaration | -
| - | ) | -- |
If streaming, write the BOM and declaration.
- -|
- TinyXML-2
- 9.0.0
-
- |
-
This is the complete list of members for tinyxml2::XMLText, including all inherited members.
-|
- TinyXML-2
- 9.0.0
-
- |
-
#include <tinyxml2.h>
-
--Public Member Functions | |
| virtual bool | Accept (XMLVisitor *visitor) const |
| -virtual XMLText * | ToText () |
| Safely cast to Text, or null. | |
| -void | SetCData (bool isCData) |
| Declare whether this should be CDATA or standard text. | |
| -bool | CData () const |
| Returns true if this is a CDATA text element. | |
| virtual XMLNode * | ShallowClone (XMLDocument *document) const |
| virtual bool | ShallowEqual (const XMLNode *compare) const |
Public Member Functions inherited from tinyxml2::XMLNode | |
| -const XMLDocument * | GetDocument () const |
| Get the XMLDocument that owns this XMLNode. | |
| -XMLDocument * | GetDocument () |
| Get the XMLDocument that owns this XMLNode. | |
| -virtual XMLElement * | ToElement () |
| Safely cast to an Element, or null. | |
| -virtual XMLComment * | ToComment () |
| Safely cast to a Comment, or null. | |
| -virtual XMLDocument * | ToDocument () |
| Safely cast to a Document, or null. | |
| -virtual XMLDeclaration * | ToDeclaration () |
| Safely cast to a Declaration, or null. | |
| -virtual XMLUnknown * | ToUnknown () |
| Safely cast to an Unknown, or null. | |
| const char * | Value () const |
| void | SetValue (const char *val, bool staticMem=false) |
| -int | GetLineNum () const |
| Gets the line number the node is in, if the document was parsed from a file. | |
| -const XMLNode * | Parent () const |
| Get the parent of this node on the DOM. | |
| -bool | NoChildren () const |
| Returns true if this node has no children. | |
| -const XMLNode * | FirstChild () const |
| Get the first child node, or null if none exists. | |
| const XMLElement * | FirstChildElement (const char *name=0) const |
| -const XMLNode * | LastChild () const |
| Get the last child node, or null if none exists. | |
| const XMLElement * | LastChildElement (const char *name=0) const |
| -const XMLNode * | PreviousSibling () const |
| Get the previous (left) sibling node of this node. | |
| -const XMLElement * | PreviousSiblingElement (const char *name=0) const |
| Get the previous (left) sibling element of this node, with an optionally supplied name. | |
| -const XMLNode * | NextSibling () const |
| Get the next (right) sibling node of this node. | |
| -const XMLElement * | NextSiblingElement (const char *name=0) const |
| Get the next (right) sibling element of this node, with an optionally supplied name. | |
| XMLNode * | InsertEndChild (XMLNode *addThis) |
| XMLNode * | InsertFirstChild (XMLNode *addThis) |
| XMLNode * | InsertAfterChild (XMLNode *afterThis, XMLNode *addThis) |
| void | DeleteChildren () |
| void | DeleteChild (XMLNode *node) |
| XMLNode * | DeepClone (XMLDocument *target) const |
| void | SetUserData (void *userData) |
| void * | GetUserData () const |
XML text.
-Note that a text node can have child element nodes, for example:
<root>This is <b>bold</b></root> -
A text node can have 2 ways to output the next. "normal" output and CDATA. It will default to the mode it was parsed from the XML file and you generally want to leave it alone, but you can change the output mode with SetCData() and query it with CData().
-
-
|
- -virtual | -
Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the XMLVisitor interface.
-This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this interface versus any other.)
-The interface has been based on ideas from:
- -Which are both good references for "visiting".
-An example of using Accept():
XMLPrinter printer; -tinyxmlDoc.Accept( &printer ); -const char* xmlcstr = printer.CStr(); --
Implements tinyxml2::XMLNode.
- -
-
|
- -virtual | -
Make a copy of this node, but not its children. You may pass in a Document pointer that will be the owner of the new Node. If the 'document' is null, then the node returned will be allocated from the current Document. (this->GetDocument())
-Note: if called on a XMLDocument, this will return null.
- -Implements tinyxml2::XMLNode.
- -
-
|
- -virtual | -
Test if 2 nodes are the same, but don't test children. The 2 nodes do not need to be in the same Document.
-Note: if called on a XMLDocument, this will return false.
- -Implements tinyxml2::XMLNode.
- -|
- TinyXML-2
- 9.0.0
-
- |
-
This is the complete list of members for tinyxml2::XMLUnknown, including all inherited members.
-|
- TinyXML-2
- 9.0.0
-
- |
-
#include <tinyxml2.h>
-
--Public Member Functions | |
| -virtual XMLUnknown * | ToUnknown () |
| Safely cast to an Unknown, or null. | |
| virtual bool | Accept (XMLVisitor *visitor) const |
| virtual XMLNode * | ShallowClone (XMLDocument *document) const |
| virtual bool | ShallowEqual (const XMLNode *compare) const |
Public Member Functions inherited from tinyxml2::XMLNode | |
| -const XMLDocument * | GetDocument () const |
| Get the XMLDocument that owns this XMLNode. | |
| -XMLDocument * | GetDocument () |
| Get the XMLDocument that owns this XMLNode. | |
| -virtual XMLElement * | ToElement () |
| Safely cast to an Element, or null. | |
| -virtual XMLText * | ToText () |
| Safely cast to Text, or null. | |
| -virtual XMLComment * | ToComment () |
| Safely cast to a Comment, or null. | |
| -virtual XMLDocument * | ToDocument () |
| Safely cast to a Document, or null. | |
| -virtual XMLDeclaration * | ToDeclaration () |
| Safely cast to a Declaration, or null. | |
| const char * | Value () const |
| void | SetValue (const char *val, bool staticMem=false) |
| -int | GetLineNum () const |
| Gets the line number the node is in, if the document was parsed from a file. | |
| -const XMLNode * | Parent () const |
| Get the parent of this node on the DOM. | |
| -bool | NoChildren () const |
| Returns true if this node has no children. | |
| -const XMLNode * | FirstChild () const |
| Get the first child node, or null if none exists. | |
| const XMLElement * | FirstChildElement (const char *name=0) const |
| -const XMLNode * | LastChild () const |
| Get the last child node, or null if none exists. | |
| const XMLElement * | LastChildElement (const char *name=0) const |
| -const XMLNode * | PreviousSibling () const |
| Get the previous (left) sibling node of this node. | |
| -const XMLElement * | PreviousSiblingElement (const char *name=0) const |
| Get the previous (left) sibling element of this node, with an optionally supplied name. | |
| -const XMLNode * | NextSibling () const |
| Get the next (right) sibling node of this node. | |
| -const XMLElement * | NextSiblingElement (const char *name=0) const |
| Get the next (right) sibling element of this node, with an optionally supplied name. | |
| XMLNode * | InsertEndChild (XMLNode *addThis) |
| XMLNode * | InsertFirstChild (XMLNode *addThis) |
| XMLNode * | InsertAfterChild (XMLNode *afterThis, XMLNode *addThis) |
| void | DeleteChildren () |
| void | DeleteChild (XMLNode *node) |
| XMLNode * | DeepClone (XMLDocument *target) const |
| void | SetUserData (void *userData) |
| void * | GetUserData () const |
Any tag that TinyXML-2 doesn't recognize is saved as an unknown. It is a tag of text, but should not be modified. It will be written back to the XML, unchanged, when the file is saved.
-DTD tags get thrown into XMLUnknowns.
-
-
|
- -virtual | -
Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the XMLVisitor interface.
-This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this interface versus any other.)
-The interface has been based on ideas from:
- -Which are both good references for "visiting".
-An example of using Accept():
XMLPrinter printer; -tinyxmlDoc.Accept( &printer ); -const char* xmlcstr = printer.CStr(); --
Implements tinyxml2::XMLNode.
- -
-
|
- -virtual | -
Make a copy of this node, but not its children. You may pass in a Document pointer that will be the owner of the new Node. If the 'document' is null, then the node returned will be allocated from the current Document. (this->GetDocument())
-Note: if called on a XMLDocument, this will return null.
- -Implements tinyxml2::XMLNode.
- -
-
|
- -virtual | -
Test if 2 nodes are the same, but don't test children. The 2 nodes do not need to be in the same Document.
-Note: if called on a XMLDocument, this will return false.
- -Implements tinyxml2::XMLNode.
- -|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-
|
- TinyXML-2
- 9.0.0
-
- |
-