|
|
|
@ -455,6 +455,38 @@ namespace xml { |
|
|
|
|
Attributes& Node::attributes() throw() { |
|
|
|
|
return _attributes; |
|
|
|
|
} |
|
|
|
|
//! Get the first child node
|
|
|
|
|
/*! Returns the first child node or throws an exception, if there are
|
|
|
|
|
no children. */ |
|
|
|
|
Node& Node::first() throw(out_of_range) { |
|
|
|
|
Contents::iterator it(_contents.begin()); |
|
|
|
|
if (it==_contents.end()) throw out_of_range(*this, 0); |
|
|
|
|
return **it; |
|
|
|
|
} |
|
|
|
|
//! Get the first child node
|
|
|
|
|
/*! Returns the first child node or throws an exception, if there are
|
|
|
|
|
no children. */ |
|
|
|
|
const Node& Node::first() const throw(out_of_range) { |
|
|
|
|
Contents::const_iterator it(_contents.begin()); |
|
|
|
|
if (it==_contents.end()) throw out_of_range(*this, 0); |
|
|
|
|
return **it; |
|
|
|
|
} |
|
|
|
|
//! Get the last child node
|
|
|
|
|
/*! Returns the last child node or throws an exception, if there are
|
|
|
|
|
no children. */ |
|
|
|
|
const Node& Node::last() const throw(out_of_range) { |
|
|
|
|
Contents::const_reverse_iterator it(_contents.rbegin()); |
|
|
|
|
if (it==_contents.rend()) throw out_of_range(*this, 0); |
|
|
|
|
return **it; |
|
|
|
|
} |
|
|
|
|
//! Get the last child node
|
|
|
|
|
/*! Returns the last child node or throws an exception, if there are
|
|
|
|
|
no children. */ |
|
|
|
|
Node& Node::last() throw(out_of_range) { |
|
|
|
|
Contents::reverse_iterator it(_contents.rbegin()); |
|
|
|
|
if (it==_contents.rend()) throw out_of_range(*this, 0); |
|
|
|
|
return **it; |
|
|
|
|
} |
|
|
|
|
//! Pass a minimal and maximal number for this node in a xml file.
|
|
|
|
|
/*! Minimal and maximal values are verified when you use the node as
|
|
|
|
|
a template in a xml::Factory. When the factory reads a stucture |
|
|
|
|