Orcus
Public Member Functions | Friends | List of all members
orcus::xml_structure_tree::walker Class Reference

#include <xml_structure_tree.hpp>

Public Member Functions

 walker (const walker &r)
 
walkeroperator= (const walker &r)
 
element root ()
 
element descend (const entity_name &name)
 
element ascend ()
 
void get_children (entity_names_type &names)
 
void get_attributes (entity_names_type &names)
 
size_t get_xmlns_index (xmlns_id_t ns) const
 
std::string get_xmlns_short_name (xmlns_id_t ns) const
 

Friends

class xml_structure_tree
 

Detailed Description

This class allows client to traverse the tree.

Member Function Documentation

element orcus::xml_structure_tree::walker::ascend ( )

Move up to the parent element.

element orcus::xml_structure_tree::walker::descend ( const entity_name name)

Descend into specified child element.

Parameters
nsnamespace of child element
namename of child element
Returns
child element
void orcus::xml_structure_tree::walker::get_attributes ( entity_names_type &  names)

Get a list of names of all attributes that belong to current element. The list of names is in order of appearance.

Parameters
nameslist of attribute names in order of appearance.
void orcus::xml_structure_tree::walker::get_children ( entity_names_type &  names)

Get a list of names of all child elements at current element position. The list of names is in order of appearance.

Parameters
nameslist of child element names in order of appearance.
size_t orcus::xml_structure_tree::walker::get_xmlns_index ( xmlns_id_t  ns) const

Get a numerical, 0-based index of given XML namespace.

Parameters
nsXML namespace ID.
Returns
numeric, 0-based index of XML namespace if found, or xml_structure_tree::walker::index_not_found if the namespace is not found in this structure.
element orcus::xml_structure_tree::walker::root ( )

Set current position to the root element, and return the root element.

Returns
root element.