MIRA
|
Const sibling_iterator for iterating over xml nodes that have the same parent (siblings) More...
#include <xml/XMLDom.h>
Public Types | |
typedef std::string | value_type |
The value type. More... | |
typedef const std::string * | pointer |
The pointer type. More... | |
typedef const std::string & | reference |
The reference type. More... | |
typedef ptrdiff_t | difference_type |
The difference type. More... | |
typedef std::bidirectional_iterator_tag | iterator_category |
The iterator category. More... | |
Public Member Functions | |
const_sibling_iterator () | |
Constructor. More... | |
const_sibling_iterator (_xmlNode *iNode, const std::string &name="") | |
Constructor. More... | |
const_sibling_iterator (const const_sibling_iterator &other) | |
Copy-constructor. More... | |
bool | operator== (const const_sibling_iterator &other) const |
Compare two iterators. More... | |
bool | operator!= (const const_sibling_iterator &other) const |
Compare two iterators. More... | |
const_sibling_iterator & | operator++ () |
Preincrement. More... | |
const_sibling_iterator & | operator+= (std::size_t increment) |
Increment self by given value. More... | |
const_sibling_iterator | operator+ (std::size_t increment) const |
Increment by given value. More... | |
const_sibling_iterator & | operator-- () |
Predecrement. More... | |
const_sibling_iterator | find (const std::string &name, std::size_t nth=0) const |
Find the nth subnode with a given name. More... | |
std::string | operator* () const |
Dereference operator to get the name of the node. More... | |
void | setName (const std::string &name) |
Change the node's name. More... | |
std::string | uri () const |
Return the uri of the node. More... | |
void | setUri (const std::string &uri) |
Set the uri of the node. More... | |
NameSpace | nameSpace () const |
Return the namespace information of the node. More... | |
uint32 | line () const |
Gets the underlying line number of the loaded document for this node. More... | |
const_sibling_iterator | cparent () const |
Get the const parent node sibling_iterator for this node. More... | |
const_sibling_iterator | parent () const |
Get the const parent node sibling_iterator for this node. More... | |
const_sibling_iterator | cbegin () const |
Get the const sibling_iterator to the first sub node. More... | |
const_sibling_iterator | cbegin (const std::string &name) const |
Get the const sibling_same_name_iterator to the first sub node with the given name. More... | |
const_sibling_iterator | begin () const |
Get the const sibling_iterator to the first sub node. More... | |
const_sibling_iterator | begin (const std::string &name) const |
Get the const sibling_same_name_iterator to the first sub node with the given name. More... | |
const_sibling_iterator | cend () const |
Get the const end node sibling_iterator. More... | |
const_sibling_iterator | end () const |
Get the const end node sibling_iterator. More... | |
const_content_iterator | content_cbegin () const |
Get the const iterator to the first content. More... | |
const_content_iterator | content_cend () const |
Get the const end content iterator. More... | |
const_content_iterator | content_begin () const |
Get the const iterator to the first content. More... | |
const_content_iterator | content_end () const |
Get the const end content iterator. More... | |
const_comment_iterator | comment_cbegin () const |
Get the const iterator to the first comment. More... | |
const_comment_iterator | comment_cend () const |
Get the const end comment iterator. More... | |
const_comment_iterator | comment_begin () const |
Get the const iterator to the first comment. More... | |
const_comment_iterator | comment_end () const |
Get the const end comment iterator. More... | |
const_attribute_iterator | attribute_cbegin () const |
Get the const iterator to the first attribute. More... | |
const_attribute_iterator | attribute_cend () const |
Get the const end attribute iterator. More... | |
const_attribute_iterator | attribute_begin () const |
Get the const iterator to the first attribute. More... | |
const_attribute_iterator | attribute_end () const |
Get the const end attribute iterator. More... | |
const_attribute_iterator | find_attribute (const std::string &name) const |
Find an attribute with the name name. More... | |
bool | has_attribute (const std::string &name) const |
Returns true if node contains the attribute with name name. More... | |
template<typename T > | |
T | get_attribute (const std::string &name) const |
Return an attribute value cast to a given type. More... | |
template<typename T > | |
T | get_attribute (const std::string &name, const T &defaultValue) const |
Return an attribute value casted to a given type If the attribute could not be found the given default value will be returned. More... | |
Protected Attributes | |
_xmlNode * | mNode |
The node pointer. More... | |
std::string | mName |
the node name (optional) More... | |
Friends | |
class | sibling_iterator |
STL-conform typedefs. More... | |
Const sibling_iterator for iterating over xml nodes that have the same parent (siblings)
typedef std::string value_type |
The value type.
typedef const std::string* pointer |
The pointer type.
typedef const std::string& reference |
The reference type.
typedef ptrdiff_t difference_type |
The difference type.
typedef std::bidirectional_iterator_tag iterator_category |
The iterator category.
Constructor.
const_sibling_iterator | ( | _xmlNode * | iNode, |
const std::string & | name = "" |
||
) |
Constructor.
[in] | iNode | The actual node. |
|
inline |
Copy-constructor.
[in] | other | The other const_sibling_iterator |
|
inline |
|
inline |
const_sibling_iterator& operator++ | ( | ) |
Preincrement.
const_sibling_iterator& operator+= | ( | std::size_t | increment | ) |
Increment self by given value.
const_sibling_iterator operator+ | ( | std::size_t | increment | ) | const |
Increment by given value.
const_sibling_iterator& operator-- | ( | ) |
Predecrement.
const_sibling_iterator find | ( | const std::string & | name, |
std::size_t | nth = 0 |
||
) | const |
Find the nth subnode with a given name.
The name can contain '/''s for separation of child names. In this case the DOM tree is traversed recursively. e.g. find("Node/SubNode/SubSubNode") returns an sibling_iterator to SubSubNode if exists. It returns the nth SubSubNode of the first SubNode in the first Node.)
[in] | name | The name of the node |
[in] | nth | The nth item with name will be found |
|
inherited |
Dereference operator to get the name of the node.
|
inherited |
Change the node's name.
|
inherited |
Return the uri of the node.
This can be the filename of the document or a web address.
|
inherited |
Set the uri of the node.
This can be the filename of the document or a web address.
|
inherited |
Return the namespace information of the node.
|
inherited |
Gets the underlying line number of the loaded document for this node.
|
inherited |
Get the const parent node sibling_iterator for this node.
|
inlineinherited |
Get the const parent node sibling_iterator for this node.
|
inherited |
Get the const sibling_iterator to the first sub node.
|
inherited |
Get the const sibling_same_name_iterator to the first sub node with the given name.
name | The name of the sibling |
|
inlineinherited |
Get the const sibling_iterator to the first sub node.
|
inlineinherited |
Get the const sibling_same_name_iterator to the first sub node with the given name.
name | The name of the sibling |
|
inherited |
Get the const end node sibling_iterator.
|
inlineinherited |
Get the const end node sibling_iterator.
|
inherited |
Get the const iterator to the first content.
|
inherited |
Get the const end content iterator.
|
inlineinherited |
Get the const iterator to the first content.
|
inlineinherited |
Get the const end content iterator.
|
inherited |
Get the const iterator to the first comment.
|
inherited |
Get the const end comment iterator.
|
inlineinherited |
Get the const iterator to the first comment.
|
inlineinherited |
Get the const end comment iterator.
|
inherited |
Get the const iterator to the first attribute.
|
inherited |
Get the const end attribute iterator.
|
inlineinherited |
Get the const iterator to the first attribute.
|
inlineinherited |
Get the const end attribute iterator.
|
inherited |
Find an attribute with the name name.
[in] | name | The attribute name. |
|
inlineinherited |
Returns true if node contains the attribute with name name.
[in] | name | The attribute name. |
|
inlineinherited |
Return an attribute value cast to a given type.
XInvalidConfig | when the attribute could not be found |
[in] | name | The name of the attribute |
|
inlineinherited |
Return an attribute value casted to a given type If the attribute could not be found the given default value will be returned.
[in] | name | The name of the attribute |
[in] | defaultValue | The default value that will be returned if the attribute is not found |
|
friend |
STL-conform typedefs.
|
protectedinherited |
The node pointer.
|
protectedinherited |
the node name (optional)