rili::XML Class Referencefinal

Classes

class  DocumentType
 
class  SyntaxError
 
class  TreeType
 

Public Types

enum  Type {
  Document, Tree, Text, CDATA,
  Comment, Doctype, Declatation
}
 
typedef std::string TextType
 
typedef std::string CDATAType
 
typedef std::string CommentType
 
typedef std::string DoctypeType
 
typedef std::string DeclarationType
 

Public Member Functions

Type type () const noexcept
 
TreeTypetree ()
 
TreeType const & tree () const
 
void tree (TreeType const &t)
 
TextTypetext ()
 
TextType const & text () const
 
void text (TextType const &t)
 
CDATATypecdata ()
 
CDATAType const & cdata () const
 
void cdata (CDATAType const &t)
 
CommentTypecomment ()
 
CommentType const & comment () const
 
void comment (CommentType const &t)
 
DeclarationTypedeclaration ()
 
DeclarationType const & declaration () const
 
void declaration (DeclarationType const &t)
 
DoctypeTypedoctype ()
 
DoctypeType const & doctype () const
 
void doctype (DoctypeType const &t)
 
DocumentTypedocument ()
 
DocumentType const & document () const
 
void document (DocumentType const &t)
 
 XML () noexcept
 
 XML (std::string const &xml, size_t maxDepth=100)
 
void parse (const std::string &xml, size_t maxDepth=100)
 
std::string stringify () const noexcept
 

Detailed Description

Note
It can be tree(<something>), text, doctype( <!something!> ), comment( <!--something--> ), cdata(<![CDATA[something]]>), declaration(<?something?>)
Warning
inner parameters of doctype and declaration nodes is not fully parsed - instead data between markers is stored as single string.

Member Typedef Documentation

typedef std::string rili::XML::CDATAType

CDATAType type in which cdata nodes are stored.

typedef std::string rili::XML::CommentType

CommentType type in which comments are stored.

typedef std::string rili::XML::DeclarationType

DeclarationType type in which declaration nodes are stored.

typedef std::string rili::XML::DoctypeType

DoctypeType type in which doctype node is stored.

typedef std::string rili::XML::TextType

TextType type in which text nodes are stored.

Member Enumeration Documentation

enum rili::XML::Type
strong

The Type enum is used to check which.

Constructor & Destructor Documentation

rili::XML::XML ( )
inlinenoexcept

XML construct documet type empty node.

rili::XML::XML ( std::string const &  xml,
size_t  maxDepth = 100 
)
inline

XML used to construct nodes tree based on given xml string.

Parameters
xmldata to parse
maxDepthmaximal allowed nasted elements depth

Member Function Documentation

CDATAType& rili::XML::cdata ( )
inline

cdata used to get node as cdata node

Returns
CDATAType const& rili::XML::cdata ( ) const
inline

cdata used to get node as cdata node

Returns
void rili::XML::cdata ( CDATAType const &  t)
inline

cdata used to set node as cdata node

Parameters
t
CommentType& rili::XML::comment ( )
inline

comment used to get node as comment node

Returns
CommentType const& rili::XML::comment ( ) const
inline

comment used to get node as comment node

Returns
void rili::XML::comment ( CommentType const &  t)
inline

comment used to set node as comment node

Parameters
t
DeclarationType& rili::XML::declaration ( )
inline

declaration used to get node as declaration node

Returns
DeclarationType const& rili::XML::declaration ( ) const
inline

declaration used to get node as declaration node

Returns
void rili::XML::declaration ( DeclarationType const &  t)
inline

declaration used to set node as declaration node

Parameters
t
DoctypeType& rili::XML::doctype ( )
inline

doctype used to get node as doctype node

Returns
DoctypeType const& rili::XML::doctype ( ) const
inline

doctype used to get node as doctype node

Returns
void rili::XML::doctype ( DoctypeType const &  t)
inline

doctype used to set node as doctype node

Parameters
t
DocumentType& rili::XML::document ( )
inline

document used to get node as document node

Returns
DocumentType const& rili::XML::document ( ) const
inline

document used to get node as document node

Returns
void rili::XML::document ( DocumentType const &  t)
inline

document used to set node as document node

Parameters
t
void rili::XML::parse ( const std::string &  xml,
size_t  maxDepth = 100 
)

parse used to parse nodes tree based on given xml string on current xml object

Parameters
xmldata to parse
maxDepthmaximal allowed nasted elements depth
std::string rili::XML::stringify ( ) const
noexcept

stringify convert XML objects tree into string document representation

Returns
stringified xml document
TextType& rili::XML::text ( )
inline

text used to get node as text node

Returns
TextType const& rili::XML::text ( ) const
inline

text used to get node as text node

Returns
void rili::XML::text ( TextType const &  t)
inline

text used to set node as text node

Parameters
t
TreeType& rili::XML::tree ( )
inline

tree used to get node as tree node

Returns
TreeType const& rili::XML::tree ( ) const
inline

tree used to get node as tree node

Returns
void rili::XML::tree ( TreeType const &  t)
inline

tree used to set node as tree node

Parameters
t
Type rili::XML::type ( ) const
inlinenoexcept

type used to check type of node

Returns

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