#include <Teuchos_XMLObject.hpp>
Public Member Functions | |
Constructors | |
| XMLObject () | |
| Empty constructor. | |
| XMLObject (const std::string &tag) | |
| Construct using a node labeled by tag. | |
| XMLObject (XMLObjectImplem *ptr) | |
| Construct with a pointer to the low-level representation. | |
Copy methods | |
| XMLObject | deepCopy () const |
| Make a deep copy of this object. | |
Data Access methods | |
| const std::string & | getTag () const |
| Return the tag of the current node. | |
| bool | hasAttribute (const std::string &name) const |
| Find out if the current node has an attribute of the specified name. | |
| const std::string & | getAttribute (const std::string &name) const |
| Return the value of the attribute with the specified name. | |
| const std::string & | getRequired (const std::string &name) const |
| Get an attribute, throwing an std::exception if it is not found. | |
| double | getRequiredDouble (const std::string &name) const |
| Get a required attribute, returning it as a double. | |
| int | getRequiredInt (const std::string &name) const |
| Get a required attribute, returning it as an int. | |
| bool | getRequiredBool (const std::string &name) const |
| Get a required attribute, returning it as a bool. | |
| std::string | getWithDefault (const std::string &name, const std::string &defaultValue) const |
| Get an attribute, assigning a default value if the requested attribute does not exist. | |
| int | numChildren () const |
| Return the number of child nodes owned by this node. | |
| const XMLObject & | getChild (int i) const |
| Return the i-th child node. | |
| int | numContentLines () const |
| Return the number of lines of character content stored in this node. | |
| const std::string & | getContentLine (int i) const |
| Return the i-th line of character content stored in this node. | |
| std::string | toString () const |
| Represent this node and its children as a std::string. | |
| void | print (std::ostream &os, int indent) const |
| Print this node and its children to stream with the given indentation. | |
| std::string | header () const |
| Write the header for this object to a std::string. | |
| std::string | terminatedHeader () const |
| Write the header for this object to a std::string. | |
| std::string | footer () const |
| Write the footer for this object to a std::string. | |
| bool | isEmpty () const |
| Find out if a node is empty. | |
| void | checkTag (const std::string &expected) const |
| Check that a tag is equal to an expected std::string. | |
Tree-Assembly methods | |
| void | addAttribute (const std::string &name, const std::string &value) |
| Add an attribute to the current node's atribute list. | |
| void | addDouble (const std::string &name, double val) |
| Add a double as an attribute. | |
| void | addInt (const std::string &name, int val) |
| Add an int as an attribute. | |
| void | addBool (const std::string &name, bool val) |
| Add a bool as an attribute. | |
| void | addChild (const XMLObject &child) |
| Add a child node to the node. | |
| void | addContent (const std::string &contentLine) |
| Add a line of character content. | |
Related Functions | |
| (Note that these are not member functions.) | |
| std::ostream & | operator<< (std::ostream &os, const XMLObject &xml) |
Write XMLObject to os stream. | |
| std::string | toString (const XMLObject &xml) |
| Write XMLObject to std::string. | |
|
|
Empty constructor.
|
|
|
Construct using a node labeled by tag.
|
|
|
Construct with a pointer to the low-level representation. This is used to allow construction of an XMLObject from the XMLObjectImplem* return value of ExceptionBase::toXML(). |
|
|
Make a deep copy of this object.
|
|
|
Return the tag of the current node.
|
|
|
Find out if the current node has an attribute of the specified name.
|
|
|
Return the value of the attribute with the specified name.
|
|
|
Get an attribute, throwing an std::exception if it is not found.
|
|
|
Get a required attribute, returning it as a double.
|
|
|
Get a required attribute, returning it as an int.
|
|
|
Get a required attribute, returning it as a bool.
|
|
||||||||||||
|
Get an attribute, assigning a default value if the requested attribute does not exist.
|
|
|
Return the number of child nodes owned by this node.
|
|
|
Return the i-th child node.
|
|
|
Return the number of lines of character content stored in this node.
|
|
|
Return the i-th line of character content stored in this node.
|
|
|
Represent this node and its children as a std::string.
|
|
||||||||||||
|
Print this node and its children to stream with the given indentation.
|
|
|
Write the header for this object to a std::string.
|
|
|
Write the header for this object to a std::string.
|
|
|
Write the footer for this object to a std::string.
|
|
|
Find out if a node is empty.
|
|
|
Check that a tag is equal to an expected std::string.
|
|
||||||||||||
|
Add an attribute to the current node's atribute list.
|
|
||||||||||||
|
Add a double as an attribute.
|
|
||||||||||||
|
Add an int as an attribute.
|
|
||||||||||||
|
Add a bool as an attribute.
|
|
|
Add a child node to the node.
|
|
|
Add a line of character content.
|
|
||||||||||||
|
Write XMLObject to
|
|
|
Write XMLObject to std::string.
|
1.3.9.1