Otclient  14/8/2020
OTMLDocument Class Reference

#include <otmldocument.h>

Inheritance diagram for OTMLDocument:
Collaboration diagram for OTMLDocument:

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>
value ()
 
template<typename T = std::string>
valueAt (const std::string &childTag)
 
template<typename T = std::string>
valueAtIndex (int childIndex)
 
template<typename T = std::string>
valueAt (const std::string &childTag, const T &def)
 
template<typename T = std::string>
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
 

Detailed Description

Definition at line 28 of file otmldocument.h.

Constructor & Destructor Documentation

◆ ~OTMLDocument()

virtual OTMLDocument::~OTMLDocument ( )
inlinevirtual

Definition at line 31 of file otmldocument.h.

Member Function Documentation

◆ create()

OTMLDocumentPtr OTMLDocument::create ( )
static

Create a new OTML document for filling it with nodes.

Definition at line 29 of file otmldocument.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ emit()

std::string OTMLDocument::emit ( )
virtual

Emits this document and all it's children to a std::string.

Reimplemented from OTMLNode.

Definition at line 53 of file otmldocument.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse() [1/2]

OTMLDocumentPtr OTMLDocument::parse ( const std::string &  fileName)
static

Parse OTML from a file.

Definition at line 36 of file otmldocument.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse() [2/2]

OTMLDocumentPtr OTMLDocument::parse ( std::istream &  in,
const std::string &  source 
)
static

Parse OTML from input stream

Parameters
sourceis the file name that will be used to show errors messages

Definition at line 44 of file otmldocument.cpp.

Here is the call graph for this function:

◆ save()

bool OTMLDocument::save ( const std::string &  fileName)

Save this document to a file.

Definition at line 58 of file otmldocument.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: