![]() |
COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
#include <XmlNode.hpp>
Inherited by XmlDoc.
Public Member Functions | |
| XmlNode () | |
| XmlNode (rapidxml::xml_node< char > *impl) | |
| ~XmlNode () | |
| XmlNode | add_node (const std::string &name, const std::string &value=std::string()) const |
| void | set_attribute (const std::string &name, const std::string &value) |
| std::string | attribute_value (const std::string &name) const |
| void | set_name (const char *name) |
| void | set_value (const char *value) |
| bool | is_valid () const |
| void | print (Uint nesting=0) const |
| void | deep_copy (XmlNode &out) const |
Public Attributes | |
| rapidxml::xml_node< char > * | content |
| Pointer to the underlying XML implementation. More... | |
Private Member Functions | |
| void | deep_copy_names_values (const XmlNode &in, XmlNode &out) const |
Represents a XML node. This class uses the Pimpl idiom. Each object is only a wrapper for an object of an underlying XML implementation. This class provides functions that ease some XML manipulation, like adding a node or adding/modifying an attribute, that need memory allocation.
A XmlNode can be easily written to a file, converted to a string or printed to screen (not in XML format) using COOLFluiD logging facility.
Definition at line 44 of file XmlNode.hpp.
| XmlNode | ( | ) |
Default constructor. Builds an invalid node.
Definition at line 22 of file XmlNode.cpp.
| XmlNode | ( | rapidxml::xml_node< char > * | impl | ) |
Builds a node from an existing one.
| impl | The node. |
| ~XmlNode | ( | ) |
Destructor. The node is removed from its parent and all its child nodes and attributes are removed.
Definition at line 26 of file XmlNode.cpp.
| XmlNode add_node | ( | const std::string & | name, |
| const std::string & | value = std::string() |
||
| ) | const |
Creates and add a node to this node with a value, if specified.
| name | The name of the new name. |
| value | The value of the new node. If empty, this parameter is ignored. |
Definition at line 38 of file XmlNode.cpp.
| std::string attribute_value | ( | const std::string & | name | ) | const |
Gets the value of an attribute.
| name | Attribute name. |
Definition at line 75 of file XmlNode.cpp.
| void deep_copy | ( | XmlNode & | out | ) | const |
Deep copies this node into another with all the memory allocated in the second.
| out | The destination node. |
Definition at line 109 of file XmlNode.cpp.
Helper function that copy the names and values to the memory pool of the out node
| in | The source node. |
| out | The destination node. |
Definition at line 123 of file XmlNode.cpp.
| bool is_valid | ( | ) | const |
Checks if the this node is valid. A node is valid if the its internal pointer to the underlying XML implementation is valid.
true if the node is valid, otherwise returns false. Definition at line 102 of file XmlNode.cpp.
| void print | ( | Uint | nesting = 0 | ) | const |
Prints the provided XML node to the logging facility.
| node | The node to print. |
| nesting | Indentation between a node and its attributes or sub-nodes. |
Definition at line 152 of file XmlNode.cpp.
| void set_attribute | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Sets an attribute of this node to a specified value. If an attribute with this name already exists, it is modified. If not, it is created.
| name | The name of the new name. |
| value | The value of the new node. |
Definition at line 54 of file XmlNode.cpp.
| void set_name | ( | const char * | name | ) |
| void set_value | ( | const char * | value | ) |
| rapidxml::xml_node<char>* content |
Pointer to the underlying XML implementation.
Definition at line 50 of file XmlNode.hpp.
1.8.9.1
|
Send comments to: COOLFluiD Web Admin |