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.
Class XMLDocument
#include <Geode/cocos/support/tinyxml2/tinyxml2.h>
Examples0
Public static methods0
Public member functions30
virtualtinyxml2::XMLDocument*ToDocument()
virtualtinyxml2::XMLDocumentconst*ToDocument()const
tinyxml2::XMLErrorParse(charconst*xml,_::size_tnBytes)
Parse an XML file from a character string. Returns XML_NO_ERROR (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 will assume ‘xml’ points to a null terminated string.
tinyxml2::XMLErrorLoadFile(charconst*filename)
Load an XML file from disk. Returns XML_NO_ERROR (0) on success, or an errorID.
tinyxml2::XMLErrorLoadFile()
Load an XML file from disk. You are responsible for providing and closing the FILE*. Returns XML_NO_ERROR (0) on success, or an errorID.
tinyxml2::XMLErrorSaveFile(charconst*filename,boolcompact)
Save the XML file to disk. Returns XML_NO_ERROR (0) on success, or an errorID.
tinyxml2::XMLErrorSaveFile(_::FILE*fp,boolcompact)
Save the XML file to disk. You are responsible for providing and closing the FILE*. Returns XML_NO_ERROR (0) on success, or an errorID.
boolProcessEntities()const
tinyxml2::WhitespaceWhitespaceMode()const
boolHasBOM()const
Returns true if this document has a leading Byte Order Mark of UTF8.
tinyxml2::XMLElement*RootElement()
Return the root element of DOM. Equivalent to FirstChildElement(). To get the first node, use FirstChild().
tinyxml2::XMLElementconst*RootElement()const
voidPrint(tinyxml2::XMLPrinter*streamer)
Print the Document. If the Printer is not provided, it will print to stdout. If you provide Printer, this can print to a file:
virtualboolAccept(tinyxml2::XMLVisitor*visitor)const
tinyxml2::XMLElement*NewElement(charconst*name)
Create a new Element associated with this Document. The memory for the Element is managed by the Document.
tinyxml2::XMLComment*NewComment(charconst*comment)
Create a new Comment associated with this Document. The memory for the Comment is managed by the Document.
tinyxml2::XMLText*NewText(charconst*text)
Create a new Text associated with this Document. The memory for the Text is managed by the Document.
tinyxml2::XMLDeclaration*NewDeclaration(charconst*text)
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.:
tinyxml2::XMLUnknown*NewUnknown(charconst*text)
Create a new Unknown associated with this Document. The memory forthe object is managed by the Document.
voidDeleteNode()
Delete a node associated with this document. It will be unlinked from the DOM.
voidSetError(tinyxml2::XMLErrorerror,charconst*str1,charconst*str2)
boolError()const
/// Return true if there was an error parsing the document.
tinyxml2::XMLErrorErrorID()const
/// Return the errorID.
charconst*GetErrorStr1()const
/// Return a possibly helpful diagnostic location or string.
charconst*GetErrorStr2()const
/// Return a possibly helpful secondary diagnostic location or string.
voidPrintError()const
/// If there is an error, print it to stdout.