#include <node.h>
Public Member Functions | |
const std::string & | operator= (const std::string &value) |
Set attribute referred to by this reference. | |
template<typename T> | |
const std::string & | operator= (const T &t) |
Set attribute referred to by this reference, after converting the parameter object to a std::string. | |
std::string | str () const |
Retrieve value of attribute referred to by this reference. | |
operator std::string () const | |
Retrieve value of attribute referred to by this reference. | |
template<typename T> | |
T & | conv (T &t) const |
Explicit conversion to any type that can be converted by Dv::Util::fromstring. | |
template<typename T> | |
operator T () const | |
Template user-defined conversion function. | |
Private Member Functions | |
AttributeReference (const xml::node::iterator n, const std::string &name) | |
Constructor. | |
Private Attributes | |
const std::string | name |
xml::node::iterator | node |
Friends | |
class | Ref |
Dv::Xml::Node::Ref::operator[](const std::string) returns an AttributeReference object.
Definition at line 97 of file node.h.
Dv::Xml::Node::AttributeReference::AttributeReference | ( | const xml::node::iterator | n, | |
const std::string & | name | |||
) | [private] |
Constructor.
n | reference to xml::node for which the attribute is considered | |
name | of the attribute |
const std::string& Dv::Xml::Node::AttributeReference::operator= | ( | const std::string & | value | ) |
Set attribute referred to by this reference.
value | to assign to attribute. |
Referenced by operator=().
const std::string& Dv::Xml::Node::AttributeReference::operator= | ( | const T & | t | ) | [inline] |
Set attribute referred to by this reference, after converting the parameter object to a std::string.
The conversion is done using Dv::Util::tostring<T>.
t | value to assign, after conversion, to attribute. |
Definition at line 115 of file node.h.
References operator=().
std::string Dv::Xml::Node::AttributeReference::str | ( | ) | const |
Retrieve value of attribute referred to by this reference.
Referenced by operator std::string(), and Dv::Xml::operator<<().
Dv::Xml::Node::AttributeReference::operator std::string | ( | ) | const [inline] |
T& Dv::Xml::Node::AttributeReference::conv | ( | T & | t | ) | const [inline] |
Explicit conversion to any type that can be converted by Dv::Util::fromstring.
t | lvalue referring to object resulting from the conversion |
Definition at line 139 of file node.h.
References Dv::Util::fromstring().
Dv::Xml::Node::AttributeReference::operator T | ( | ) | const [inline] |
Template user-defined conversion function.
Dv::Xml::Node::Ref n; std::string s1(n["a"]); // error std::string s2 = n["a"]; // OK
const std::string Dv::Xml::Node::AttributeReference::name [private] |
xml::node::iterator Dv::Xml::Node::AttributeReference::node [private] |
dvxml-0.1.7 | [ 7 January, 2008] |