Otclient
14/8/2020
|
#include <otmldocument.h>
Public Member Functions | |
virtual | ~OTMLDocument () |
std::string | emit () |
Emits this document and all it's children to a std::string. More... | |
bool | save (const std::string &fileName) |
Save this document to a file. More... | |
Public Member Functions inherited from OTMLNode | |
virtual | ~OTMLNode () |
std::string | tag () |
int | size () |
std::string | source () |
std::string | rawValue () |
bool | isUnique () |
bool | isNull () |
bool | hasTag () |
bool | hasValue () |
bool | hasChildren () |
bool | hasChildAt (const std::string &childTag) |
bool | hasChildAtIndex (int childIndex) |
void | setTag (const std::string &tag) |
void | setValue (const std::string &value) |
void | setNull (bool null) |
void | setUnique (bool unique) |
void | setSource (const std::string &source) |
OTMLNodePtr | get (const std::string &childTag) |
OTMLNodePtr | getIndex (int childIndex) |
OTMLNodePtr | at (const std::string &childTag) |
OTMLNodePtr | atIndex (int childIndex) |
void | addChild (const OTMLNodePtr &newChild) |
bool | removeChild (const OTMLNodePtr &oldChild) |
bool | replaceChild (const OTMLNodePtr &oldChild, const OTMLNodePtr &newChild) |
void | copy (const OTMLNodePtr &node) |
void | merge (const OTMLNodePtr &node) |
void | clear () |
OTMLNodeList | children () |
OTMLNodePtr | clone () |
template<typename T = std::string> | |
T | value () |
template<typename T = std::string> | |
T | valueAt (const std::string &childTag) |
template<typename T = std::string> | |
T | valueAtIndex (int childIndex) |
template<typename T = std::string> | |
T | valueAt (const std::string &childTag, const T &def) |
template<typename T = std::string> | |
T | valueAtIndex (int childIndex, const T &def) |
template<typename T > | |
void | write (const T &v) |
template<typename T > | |
void | writeAt (const std::string &childTag, const T &v) |
template<typename T > | |
void | writeIn (const T &v) |
OTMLNodePtr | asOTMLNode () |
Public Member Functions inherited from stdext::shared_object | |
shared_object () | |
virtual | ~shared_object () |
void | add_ref () |
void | dec_ref () |
refcount_t | ref_count () |
template<typename T > | |
stdext::shared_object_ptr< T > | static_self_cast () |
template<typename T > | |
stdext::shared_object_ptr< T > | dynamic_self_cast () |
template<typename T > | |
stdext::shared_object_ptr< T > | const_self_cast () |
Static Public Member Functions | |
static OTMLDocumentPtr | create () |
Create a new OTML document for filling it with nodes. More... | |
static OTMLDocumentPtr | parse (const std::string &fileName) |
Parse OTML from a file. More... | |
static OTMLDocumentPtr | parse (std::istream &in, const std::string &source) |
Static Public Member Functions inherited from OTMLNode | |
static OTMLNodePtr | create (std::string tag="", bool unique=false) |
static OTMLNodePtr | create (std::string tag, std::string value) |
Additional Inherited Members | |
Protected Member Functions inherited from OTMLNode | |
OTMLNode () | |
Protected Attributes inherited from OTMLNode | |
OTMLNodeList | m_children |
std::string | m_tag |
std::string | m_value |
std::string | m_source |
bool | m_unique |
bool | m_null |
Definition at line 28 of file otmldocument.h.
|
inlinevirtual |
Definition at line 31 of file otmldocument.h.
|
static |
Create a new OTML document for filling it with nodes.
Definition at line 29 of file otmldocument.cpp.
|
virtual |
Emits this document and all it's children to a std::string.
Reimplemented from OTMLNode.
Definition at line 53 of file otmldocument.cpp.
|
static |
Parse OTML from a file.
Definition at line 36 of file otmldocument.cpp.
|
static |
Parse OTML from input stream
source | is the file name that will be used to show errors messages |
Definition at line 44 of file otmldocument.cpp.
bool OTMLDocument::save | ( | const std::string & | fileName | ) |
Save this document to a file.
Definition at line 58 of file otmldocument.cpp.