an wrapper interface for easy access to XML DOM parser. This require an active back-end that does the actual parsing and validation.
More...
|
virtual | ~DOMElem () |
| destructor
|
|
virtual bool | isName (const std::string &elemname) const =0 |
| test if name of this elem equals elemname More...
|
|
virtual const std::string & | getName () const =0 |
| get name of this DOMElem More...
|
|
virtual std::string | getValue () const =0 |
| get string value of this DOMElem More...
|
|
virtual int | getValueAsInt () const =0 |
| get value as an integer, throws an exception if this is not an int value. More...
|
|
virtual double | getValueAsDouble () const =0 |
| get value as an double floating point, throws an exception if this is not an double value. More...
|
|
virtual std::vector< std::string > | getValueAsStringList (char stringseperator=';') const =0 |
| get value as a list of strings, throws an exception if this is not a list of strings. The default string seperator is semicolon (;). More...
|
|
virtual std::vector< double > | getValueAsDoubleList () const =0 |
| get value as a list of doubles, throws an exception if this is not a list of doubles. The default string seperator is space ( ). More...
|
|
virtual std::vector< double > | getValueAsDoubleList (int N) const =0 |
| get value as a list of N doubles, throws an exception if this is not a list of N doubles. The default string seperator is space ( ). More...
|
|
virtual rw::core::Ptr< DOMElem > | getChild (const std::string &name, bool optional=false)=0 |
| get a child with a specific name. If more children with the same name occur then it cannot be guaranteed which is returned. If optional is false then an exception will be thrown if the child cannot be found. If optional is true then NULL is returned if child is not found. More...
|
|
virtual rw::core::Ptr< DOMElem > | getAttribute (const std::string &name, bool optional=false)=0 |
| get a attribute with a specific name. If more attributes with the same name occur then it cannot be guaranteed which is returned. If optional is false then an exception will be thrown if the child cannot be found. If optional is true then NULL is returned if child is not found. More...
|
|
virtual bool | hasChild (const std::string &name) const =0 |
| test if this DOMElem has a child by name name. More...
|
|
virtual bool | hasChildren () const =0 |
| test if this DOMElem has any children More...
|
|
virtual bool | hasAttribute (const std::string &name) const =0 |
| test if this DOMElem has an attribute by name name. More...
|
|
std::string | getAttributeValue (const std::string &name) |
| Get the value of attribute as a string. More...
|
|
std::string | getAttributeValue (const std::string &name, const std::string &default_value) |
| Get the value of attribute as a string. More...
|
|
int | getAttributeValueAsInt (const std::string &name) |
| Get the value of attribute as an integer. More...
|
|
int | getAttributeValueAsInt (const std::string &name, int default_value) |
| Get the value of attribute as an integer. More...
|
|
double | getAttributeValueAsDouble (const std::string &name) |
| Get the value of attribute as an double. More...
|
|
double | getAttributeValueAsDouble (const std::string &name, double default_value) |
| Get the value of attribute as an double. More...
|
|
bool | getValueAsBool () |
| Get the value as a boolean. More...
|
|
bool | getAttributeValueAsBool (const std::string &name) |
| Get the value of attribute as an boolean. More...
|
|
bool | getAttributeValueAsBool (const std::string &name, bool default_value) |
| Get the value of attribute as an boolean. More...
|
|
virtual Iterator | begin ()=0 |
| Get iterator to first child element. More...
|
|
virtual Iterator | end ()=0 |
| Get iterator to last child element. More...
|
|
virtual IteratorPair | getChildren ()=0 |
| Get iterator to child elements. More...
|
|
virtual IteratorPair | getAttributes ()=0 |
| Get iterator to attributes. More...
|
|
virtual rw::core::Ptr< DOMElem > | addChild () |
| Add a child with an empty name. More...
|
|
virtual rw::core::Ptr< DOMElem > | addChild (const std::string &name)=0 |
| Add a child element. More...
|
|
virtual rw::core::Ptr< DOMElem > | addAttribute (const std::string &name)=0 |
| Add an attribute element. More...
|
|
virtual void | setValue (const std::string &val)=0 |
| Set the value of this element. More...
|
|
virtual void | setName (const std::string &val)=0 |
| Set the name of this element. More...
|
|
virtual void | setValue (bool val) |
| Set the value of this element. More...
|
|
virtual void | setValue (int val) |
| Set the value of this element. More...
|
|
virtual void | setValue (double val) |
| Set the value of this element. More...
|
|
virtual void | setValue (const char *val) |
| Set the value of this element. More...
|
|
virtual void | setValueString (std::string val) |
| Set the value of this element. More...
|
|
an wrapper interface for easy access to XML DOM parser. This require an active back-end that does the actual parsing and validation.
The DOMElem consist of a <name>, <value> and a DOMElem list of <attributes> and <children>. The value is a string and can (for convenience) be extracted as different primitive values on the interface eg. double or std::vector<double>. Attributes are DOMElem that does not have any children. Children are DOMElem that might contain other children.