Modeler Extensions Framework
XMLDocument Class Reference
Inheritance diagram for XMLDocument:
XMLElement

Public Member Functions

 XMLDocument (CLEMEXTXML *item=NULL)
 
 XMLDocument (const XMLDocument &other)
 
XMLDocumentoperator= (const XMLDocument &other)
 
virtual ~XMLDocument ()
 
void dispose ()
 
void doc2string (std::string &str)
 
- Public Member Functions inherited from XMLElement
 XMLElement (CLEMEXTXML *item=NULL)
 
virtual ~XMLElement ()
 
void getName (std::string &name)
 
bool hasAttribute (const std::string &name)
 
void getAttribute (const std::string &name, std::string &value)
 
std::string getAttribute (const std::string &name)
 
XMLElement getElementByAttribute (const std::string name, const std::string &attr_name, const std::string attr_value)
 
bool getAttribute (const std::string &name, CLEMEXTReal &value)
 
bool getAttribute (const std::string &name, CLEMEXTInteger &value)
 
void addAttribute (const std::string &name, const std::string &value)
 
void addAttribute (const std::string &name, CLEMEXTInteger value)
 
void removeAttribute (const std::string &name)
 
XMLElementIterator getElements (const std::string &name)
 
XMLTextIterator getTextSections ()
 
XMLElement addElement (const std::string &name)
 
void addText (const std::string &data)
 
bool isValid () const
 
XMLElement getElement (const std::string &name)
 
XMLElement getElement (const std::string &name, int index)
 

Static Public Member Functions

static XMLDocument createFromString (CLEMEXTHost *host, const char *str)
 
static XMLDocument createNew (CLEMEXTHost *host, const char *root_element_name)
 

Additional Inherited Members

- Protected Attributes inherited from XMLElement
CLEMEXTXML * item_
 

Detailed Description

class wrapping an XMLDocument (also represents the root element of that document)

Definition at line 252 of file XMLHelper.h.

Constructor & Destructor Documentation

XMLDocument ( CLEMEXTXML *  item = NULL)

create from a CLEMEXT C-API object

Parameters
itemthe CLEMEXT C-API object pointer representing a root XML element
XMLDocument ( const XMLDocument other)

copy constructor (new document shares the underlying resource with original)

Parameters
otherthe document to copy
virtual ~XMLDocument ( )
virtual

destroy, but do not delete the underlying CLEMEXTXML object

Member Function Documentation

static XMLDocument createFromString ( CLEMEXTHost *  host,
const char *  str 
)
static

obtain a new XMLDocument by parsing a string value containing XML content

Parameters
hostthe CLEMEXTHost pointer to use in obtaining CLEMEXT XML service callbacks
strstring containing XML content
Returns
pointer to new XMLDocument object
static XMLDocument createNew ( CLEMEXTHost *  host,
const char *  root_element_name 
)
static

create a new XMLDocument with a given root element name

Parameters
hostthe CLEMEXTHost pointer to use in obtaining CLEMEXT XML service callbacks
root_element_namestring name of root element
Returns
pointer to new XMLDocument object
void dispose ( )

dispose of the underlying CLEMEXTXML object

void doc2string ( std::string &  str)

convert this document to a string

Parameters
strreference to string to hold the result of conversion
XMLDocument& operator= ( const XMLDocument other)

assignment operator (new document shares the underlying resource with original)

Parameters
otherthe document to assign

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