Orcus
|
#include <xml_structure_tree.hpp>
Public Member Functions | |
walker (const walker &r) | |
walker & | operator= (const walker &r) |
element | root () |
element | descend (const entity_name &name) |
element | ascend () |
element | move_to (const std::string &path) |
entity_names_type | get_children () |
entity_names_type | get_attributes () |
size_t | get_xmlns_index (xmlns_id_t ns) const |
std::string | get_xmlns_short_name (xmlns_id_t ns) const |
std::string | to_string (const entity_name &name) const |
std::string | get_path () const |
Friends | |
class | xml_structure_tree |
This class allows client to traverse the tree.
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 a specified child element.
name | name of a child element. |
general_error | if no child elements exist for the specified name. |
entity_names_type orcus::xml_structure_tree::walker::get_attributes | ( | ) |
Get a list of names of all attributes that belong to current element. The list of names is in order of appearance.
entity_names_type orcus::xml_structure_tree::walker::get_children | ( | ) |
Get a list of names of all child elements at the current element position. The list of names is in order of appearance.
std::string orcus::xml_structure_tree::walker::get_path | ( | ) | const |
Get a XPath like ID for the element inside of the XML tree.
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.
ns | XML namespace ID. |
xml_structure_tree::walker::index_not_found
if the namespace is not found in this structure. element orcus::xml_structure_tree::walker::move_to | ( | const std::string & | path | ) |
Move to the element specified by a path expression. The path expression may be generated by xml_structure_tree::walker::get_path
.
path | a simple XPath like expression |
element orcus::xml_structure_tree::walker::root | ( | ) |
Set current position to the root element, and return the root element.
std::string orcus::xml_structure_tree::walker::to_string | ( | const entity_name & | name | ) | const |
Convert an entity name to its proper string representation.
name | entity name to convert to string. |