#include <node.h>
Inheritance diagram for Dv::Xml::Node::Ref:
Public Member Functions | |
Ref (xml::node &node) | |
Construct a Dv::Xml::Node::Ref out of a (copy of a) xml::node object. | |
std::string | name () const throw (Dv::Xml::Exception) |
Dv::Xml::Node::Ref & | name (const std::string &nm) throw (Dv::Xml::Exception) |
Set name of underlying xml::node. | |
bool | nil () const |
Is this a "non-null" Dv::Xml::Node::Ref, i.e. | |
bool | operator! () const |
Is this not a valid Dv::Xml::Node::Ref, i.e. | |
operator const xml::node * () const | |
Retrieve underlying xml::node for this Dv::Xml::Node::Ref. | |
Ref | end () const throw (Dv::Xml::Exception) |
Return Ref that points past the last child of this node. | |
Ref | operator++ () throw (Dv::Xml::Exception) |
Return next child of parent with same name. | |
const Dv::Xml::Node::Ref & | operator * () const |
Dummy dereference operator, const version. | |
Dv::Xml::Node::Ref & | operator * () |
Dummy dereference operator, non-const version. | |
bool | defined (const std::string &name) const throw (Dv::Xml::Exception) |
Check whether this node has an attribute value for given key. | |
const std::string | operator() (const std::string &name) const throw (Dv::Xml::Exception) |
Retrieve attribute value. | |
AttributeReference | operator[] (const std::string &name) throw (Dv::Xml::Exception) |
Set attribute value. | |
operator std::string () const throw (Dv::Xml::Exception) | |
Retrieve text content. | |
template<typename T> | operator T () const |
Template user-defined conversion function. | |
std::string | str (bool trim=true) const throw (Dv::Xml::Exception) |
Retrieve text content. | |
Ref & | operator= (const std::string &text) throw (Dv::Xml::Exception) |
Set text content. | |
template<typename T> const std::string | operator= (const T &t) |
Set content of node referred to by this reference, after converting the parameter object to a std::string. | |
Ref & | replace (const Ref &ref) |
Replace this node by another one. | |
Protected Member Functions | |
Ref (xml::node::iterator it, bool nil=false) | |
Constructor. | |
Ref (xml::node::const_iterator it, bool nil=false) | |
Constructor. | |
void | assert_valid (const std::string &message) const throw (Dv::Xml::Exception) |
Throw an exception if this Dv::Xml::Node::Ref object does not refer to a valid xml::node. | |
Private Attributes | |
xml::node::iterator | it_ |
Refers to xml::node, if valid. | |
bool | nil_ |
False iff it_ refers to a valid xml::node. | |
Friends | |
class | Node |
class | Document |
Dv::Xml::Node::Ref | operator/ (const Dv::Xml::Node::Ref &ref, const std::string &name) throw (Dv::Xml::Exception) |
Retrieve child node with matching name. | |
bool | operator== (const Dv::Xml::Node::Ref &n, const Dv::Xml::Node::Ref &m) |
Equality test. | |
bool | operator!= (const Dv::Xml::Node::Ref m, const Dv::Xml::Node::Ref &n) |
Inequality test. | |
Dv::Xml::Node::Ref | operator>> (const Dv::Xml::Node::Ref &ref, const std::string &name) throw (Dv::Xml::Exception) |
Append new child node with given name. | |
Dv::Xml::Node::Ref | operator>> (const Dv::Xml::Node::Ref &ref, const Dv::Xml::Node::Ref &child) throw (Dv::Xml::Exception) |
Append copy of node to children of this node. |
Definition at line 184 of file node.h.
|
Construct a Dv::Xml::Node::Ref out of a (copy of a) xml::node object.
|
|
Constructor.
|
|
Constructor.
|
|
|
|
Set name of underlying xml::node.
|
|
Is this a "non-null" Dv::Xml::Node::Ref, i.e. does it refer to a valid xml::node?
|
|
Is this not a valid Dv::Xml::Node::Ref, i.e. does it not refer to a valid xml::node?
|
|
Retrieve underlying xml::node for this Dv::Xml::Node::Ref. This function can also be used to check whether this is a nil node. Dv::Xml::Node::Ref n(root/"child"/"grandchild"); if (n) { .. }
|
|
Return Ref that points past the last child of this node.
Referenced by Dv::Xml::Node::end(). |
|
Return next child of parent with same name.
|
|
Dummy dereference operator, const version. This member function is needed to support forward iterator interface.
|
|
Dummy dereference operator, non-const version. This member function is needed to support forward iterator interface.
|
|
Check whether this node has an attribute value for given key.
|
|
Retrieve attribute value.
|
|
Set attribute value.
|
|
Retrieve text content. Note that the resulting string is trimmed, i.e. leading and trailing white space is removed. To prevent trimming: use Dv::Xml::Node::Ref::str(false).
|
|
Template user-defined conversion function.
Definition at line 376 of file node.h. References Dv::Util::fromstring(). |
|
Retrieve text content.
|
|
Set text content.
|
|
Set content of node referred to by this reference, after converting the parameter object to a std::string. The conversion is done using Dv::Util::tostring<T>.
|
|
Replace this node by another one. The replacement will take place in the tree of which this Ref is a part.
|
|
Throw an exception if this Dv::Xml::Node::Ref object does not refer to a valid xml::node.
|
|
|
|
|
|
Retrieve child node with matching name.
|
|
Equality test.
|
|
Inequality test.
|
|
Append new child node with given name.
|
|
Append copy of node to children of this node.
|
|
Refers to xml::node, if valid.
|
|
False iff it_ refers to a valid xml::node.
|
dvxml-0.1.4 | [19 September, 2003] |