#include <ClearSilverNode.h>
Public Types | |
| typedef _hdf | HDF |
| ClearSilver C dataset. | |
| typedef _attr | HDF_ATTR |
Public Member Functions | |
| void | swap (ClearSilverNode &) throw () |
| Swap contents with another object. | |
| void | sort (ClearSilverNodeComparator::Ptr) |
| Sort the children. | |
Constructors and assignment operators | |
| ClearSilverNode () | |
| ClearSilverNode (HDF *) | |
| Construct the root node of an HDF dataset. | |
| ClearSilverNode (const ClearSilverNode &) | |
| Copy constructor. | |
| ~ClearSilverNode () throw () | |
| Destructor. | |
| ClearSilverNode & | operator= (const ClearSilverNode &n) |
| Assignment operator. | |
| ClearSilverNode & | operator= (const char *value) |
| Assign a new value to an HDF node. | |
| ClearSilverNode & | operator= (const std::string &) |
| Assign a new value to an HDF node. | |
| ClearSilverNode & | operator= (int) |
| Assign a new value to an HDF node. | |
| ClearSilverNode & | operator= (bool) |
| Assign a new value to an HDF node. | |
STL inspectors | |
| bool | empty () const |
| Is this node empty? | |
Conversions | |
| operator bool () const | |
| Is this node valid? | |
Node accessors | |
| std::string | name () const |
| Return the name (i.e., the last path component) of the node. | |
| std::string | value () const |
| Return the value of the node. | |
Tree traversers | |
| HDF * | get () const |
| Access the node structure directly. | |
| ClearSilverNode | top () const |
| Access the top (root) node of the dataset. | |
| ClearSilverNode | next () const |
| Access the next node at the same nesting depth. | |
| ClearSilverNode | child () const |
| Access the child node of the current one. | |
| HDF_ATTR * | attr () const |
| Access the attribute list of the current node. | |
HDF dataset operations | |
| std::string | get_value (const std::string &key, const std::string &default_value) const |
| void | set_value (const std::string &key, const std::string &value) |
| void | set_value (const std::string &key, int value) |
| void | set_value (const std::string &key, unsigned int value) |
| void | set_value (const std::string &key, bool value) |
| ClearSilverNode | get_node (const std::string &) |
| ClearSilverNode | get_obj (const std::string &) const |
| ClearSilverNode | get_child (const std::string &) const |
| void | remove_tree () |
| void | remove_tree (const std::string &) |
| void | read_file (const std::string &) |
| void | write_file (const std::string &) const |
| void | dump (const std::string &) const |
| void | copy (const std::string &, const ClearSilverNode &) |
| Deep copy. | |
Static Public Member Functions | |
| static bool & | debug () |
| Access the debug flag. | |
Boolean constants | |
These string values represent the boolean constants "true" and "false" within the dataset. This simplifies, for example, the comparison of node values expected to represent boolean values with a consistent set of contants. | |
| static std::string | Boolean (bool) |
| A standard string representing the appropriate boolean value. | |
| static std::string | True () |
| A standard string representing a true boolean value. | |
| static std::string | False () |
| A standard string representing a false boolean value. | |
Friends | |
| bool | operator== (const ClearSilverNode &, const ClearSilverNode &) |
| Equality comparison operator. | |
This class encapsulates the interface to a ClearSilver HDF dataset node. Essentially, it provides a C++ interface to the ClearSilver C API for HDF nodes. It is not intended as a primary interface to a ClearSilver dataset; rather, it provides an implementation used by the primary interfaces ConstHDF and HDF.
Additionally, this class performs no memory management. It is assumed that this object points to valid ClearSilver HDF dataset nodes managed by some other class, for example a RootNode object.
Definition at line 68 of file ClearSilverNode.h.
|
|
Construct the root node of an HDF dataset. If a ClearSilverNode owns the HDF dataset node, it is responsible for memory management of the entire dataset. Consequently, there should be only a single such node corresponding to each dataset. The primary dataset classes ConstHDF and HDF maintain this through a boost::shared_ptr<ClearSilverNode>, which ensures that a single copy of the root node is shared among all copies of the dataset. Definition at line 65 of file ClearSilverNode.cc. |
|
||||||||||||
|
Deep copy. This function copies the tree rooted at a specific node to the named node beneath the current node. Note that the contents of a symbolic link, not the link, are copied. Referenced by ClearSilver::HDF::copy(). |
|
|
Access the debug flag. If the debug flag is true, syslog(3) messages with priority LOG_DEBUG will be logged. Definition at line 581 of file ClearSilverNode.cc. Referenced by attr(), child(), name(), next(), operator=(), top(), and value(). |
|
|
Assign a new value to an HDF node. This method replaces the value of a node with a string version of its argument. Specifically, the value returned by the Boolean() method replaces the value of the node. Definition at line 136 of file ClearSilverNode.cc. References False(), operator=(), and True(). |
|
|
Assign a new value to an HDF node. This method replaces the value of a node with its argument. Definition at line 121 of file ClearSilverNode.cc. References std::basic_string< _CharT, _Traits, _Alloc >::c_str(), debug(), and ClearSilver::ConstHDFNode::name(). |
|
|
Assign a new value to an HDF node. This method replaces the value of a node with its argument.
|
|
|
Assign a new value to an HDF node. This method replaces the value of a node with its argument. Definition at line 84 of file ClearSilverNode.cc. References operator=(). |
1.4.5