CXMLDocument Class Reference

facate for an XML document More...

#include <mia/core/xmlinterface.hh>

Public Member Functions

CXMLElement::Pointer create_root_node (const char *name)
 
 CXMLDocument ()
 
 CXMLDocument (const char *init)
 
CXMLElement::Pointer get_root_node () const
 
bool read_from_string (const char *init)
 
std::string write_to_string (const char *encoding=NULL, bool formatted=true) const
 

Friends

class CXMLElement
 

Detailed Description

facate for an XML document

This class implements a very simple facade for a XML document that only supports reading, writing, and retriving the root node of the document.

Definition at line 135 of file xmlinterface.hh.

Constructor & Destructor Documentation

◆ CXMLDocument() [1/2]

CXMLDocument::CXMLDocument ( )

Create an empty document

◆ CXMLDocument() [2/2]

CXMLDocument::CXMLDocument ( const char *  init)

Read the document from a charactar string that comprises valid XML.

Member Function Documentation

◆ create_root_node()

CXMLElement::Pointer CXMLDocument::create_root_node ( const char *  name)

Create a new root node and return it

Parameters
nametag of the root node
Returns
the newly created node

◆ get_root_node()

CXMLElement::Pointer CXMLDocument::get_root_node ( ) const
Returns
the root node of the document, it may be an empty shared pointer

◆ read_from_string()

bool CXMLDocument::read_from_string ( const char *  init)

Read the document tree from an XML formatted string

Parameters
initthe valid XML string
Returns
true if successful, false otherwise

◆ write_to_string()

std::string CXMLDocument::write_to_string ( const char *  encoding = NULL,
bool  formatted = true 
) const

Write the document data as XML to a string.

Parameters
encodingspecify the encoding to be used
formattedwrite the xml in a nicely formatted, human readable way
Returns
the string containing the xml tree

Friends And Related Function Documentation

◆ CXMLElement

friend class CXMLElement
friend

Definition at line 179 of file xmlinterface.hh.


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