MIRA
Public Member Functions | Protected Attributes | List of all members
XMLDom::iterator_base Class Reference

Base iterator for iterating over xml nodes with the same parent (siblings) More...

#include <xml/XMLDom.h>

Inheritance diagram for XMLDom::iterator_base:
Inheritance graph
[legend]

Public Member Functions

 iterator_base (_xmlNode *node, const std::string &name)
 Constructor. 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 begin () 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 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 >
get_attribute (const std::string &name) const
 Return an attribute value cast to a given type. More...
 
template<typename 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...
 

Detailed Description

Base iterator for iterating over xml nodes with the same parent (siblings)

Constructor & Destructor Documentation

◆ iterator_base()

iterator_base ( _xmlNode *  node,
const std::string &  name 
)

Constructor.

Parameters
[in]nodeThe actual node.
[in]nameFor iterating over siblings with same name

Member Function Documentation

◆ operator*()

std::string operator* ( ) const

Dereference operator to get the name of the node.

Returns
Returns the node name.

◆ setName()

void setName ( const std::string &  name)

Change the node's name.

◆ uri()

std::string uri ( ) const

Return the uri of the node.

This can be the filename of the document or a web address.

Returns
The uri of the node.

◆ setUri()

void setUri ( const std::string &  uri)

Set the uri of the node.

This can be the filename of the document or a web address.

◆ nameSpace()

NameSpace nameSpace ( ) const

Return the namespace information of the node.

Returns
Namespace information

◆ line()

uint32 line ( ) const

Gets the underlying line number of the loaded document for this node.

Returns
Line number

◆ cparent()

const_sibling_iterator cparent ( ) const

Get the const parent node sibling_iterator for this node.

Returns
Const sibling_iterator to parent node

◆ parent()

const_sibling_iterator parent ( ) const
inline

Get the const parent node sibling_iterator for this node.

Returns
Const sibling_iterator to parent node

◆ cbegin() [1/2]

const_sibling_iterator cbegin ( ) const

Get the const sibling_iterator to the first sub node.

Returns
The const sibling_iterator.

◆ begin() [1/2]

const_sibling_iterator begin ( ) const
inline

Get the const sibling_iterator to the first sub node.

Returns
The const sibling_iterator.

◆ cbegin() [2/2]

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.

Parameters
nameThe name of the sibling
Returns
The const sibling_same_name_iterator.

◆ begin() [2/2]

const_sibling_iterator begin ( const std::string &  name) const
inline

Get the const sibling_same_name_iterator to the first sub node with the given name.

Parameters
nameThe name of the sibling
Returns
The const sibling_same_name_iterator.

◆ cend()

const_sibling_iterator cend ( ) const

Get the const end node sibling_iterator.

Returns
The const end sibling_iterator.

◆ end()

const_sibling_iterator end ( ) const
inline

Get the const end node sibling_iterator.

Returns
The const end sibling_iterator.

◆ content_cbegin()

const_content_iterator content_cbegin ( ) const

Get the const iterator to the first content.

Returns
The const content iterator.

◆ content_cend()

const_content_iterator content_cend ( ) const

Get the const end content iterator.

Returns
The const end iterator.

◆ content_begin()

const_content_iterator content_begin ( ) const
inline

Get the const iterator to the first content.

Returns
The const content iterator.

◆ content_end()

const_content_iterator content_end ( ) const
inline

Get the const end content iterator.

Returns
The const end iterator.

◆ comment_cbegin()

const_comment_iterator comment_cbegin ( ) const

Get the const iterator to the first comment.

Returns
The const comment iterator.

◆ comment_cend()

const_comment_iterator comment_cend ( ) const

Get the const end comment iterator.

Returns
The const end iterator.

◆ comment_begin()

const_comment_iterator comment_begin ( ) const
inline

Get the const iterator to the first comment.

Returns
The const comment iterator.

◆ comment_end()

const_comment_iterator comment_end ( ) const
inline

Get the const end comment iterator.

Returns
The const end iterator.

◆ attribute_cbegin()

const_attribute_iterator attribute_cbegin ( ) const

Get the const iterator to the first attribute.

Returns
The const attribute iterator.

◆ attribute_cend()

const_attribute_iterator attribute_cend ( ) const

Get the const end attribute iterator.

Returns
The const end iterator.

◆ attribute_begin()

const_attribute_iterator attribute_begin ( ) const
inline

Get the const iterator to the first attribute.

Returns
The const attribute iterator.

◆ attribute_end()

const_attribute_iterator attribute_end ( ) const
inline

Get the const end attribute iterator.

Returns
The const end iterator.

◆ find_attribute()

const_attribute_iterator find_attribute ( const std::string &  name) const

Find an attribute with the name name.

Parameters
[in]nameThe attribute name.
Returns
The const attribute iterator. end iterator if not exists.

◆ has_attribute()

bool has_attribute ( const std::string &  name) const
inline

Returns true if node contains the attribute with name name.

Parameters
[in]nameThe attribute name.
Returns
true if the attribute exists.

◆ get_attribute() [1/2]

T get_attribute ( const std::string &  name) const
inline

Return an attribute value cast to a given type.

Exceptions
XInvalidConfigwhen the attribute could not be found
Parameters
[in]nameThe name of the attribute
Returns
The casted value of the attribute

◆ get_attribute() [2/2]

T get_attribute ( const std::string &  name,
const T &  defaultValue 
) const
inline

Return an attribute value casted to a given type If the attribute could not be found the given default value will be returned.

Parameters
[in]nameThe name of the attribute
[in]defaultValueThe default value that will be returned if the attribute is not found
Returns
The casted value of the attribute

Member Data Documentation

◆ mNode

_xmlNode* mNode
protected

The node pointer.

◆ mName

std::string mName
protected

the node name (optional)


The documentation for this class was generated from the following file: