XMLStorage::const_XMLPos Struct Reference

iterator for XML trees More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::const_XMLPos:

Collaboration graph
[legend]

Public Member Functions

 const_XMLPos (const XMLNode *root)
 const_XMLPos (const const_XMLPos &other)
const XMLNodecur () const
 access to current node
 operator const XMLNode * () const
 C++ access to current node.
const XMLNodeoperator-> () const
const XMLNodeoperator * () const
XS_String get (const XS_String &attr_name) const
 attribute access
template<typename T>
XS_String get (const T &attr_name) const
 C++ attribute access.
bool back ()
 go back to previous position
bool go_down ()
 go down to first child
bool go_down (const XS_String &name, int n=0)
 search for child and go down
bool go (const char *path)
 move XPath like to position in XML tree
const XS_Stringstr () const

Protected Member Functions

void go_to (const XMLNode *child)
 go to specified node

Protected Attributes

const XMLNode_root
const XMLNode_cur
std::stack< const XMLNode * > _stack

Detailed Description

iterator for XML trees

Definition at line 1478 of file xmlstorage.h.


Constructor & Destructor Documentation

XMLStorage::const_XMLPos::const_XMLPos ( const XMLNode root  )  [inline]

Definition at line 1480 of file xmlstorage.h.

01481      :  _root(root),
01482         _cur(root)
01483     {
01484     }

XMLStorage::const_XMLPos::const_XMLPos ( const const_XMLPos other  )  [inline]

Definition at line 1486 of file xmlstorage.h.

01487      :  _root(other._root),
01488         _cur(other._cur)
01489     {   // don't copy _stack
01490     }


Member Function Documentation

const XMLNode& XMLStorage::const_XMLPos::cur (  )  const [inline]

access to current node

Definition at line 1493 of file xmlstorage.h.

01494     {
01495         return *_cur;
01496     }

XMLStorage::const_XMLPos::operator const XMLNode * (  )  const [inline]

C++ access to current node.

Definition at line 1499 of file xmlstorage.h.

01499 {return _cur;}

const XMLNode* XMLStorage::const_XMLPos::operator-> (  )  const [inline]

Definition at line 1501 of file xmlstorage.h.

01501 {return _cur;}

const XMLNode& XMLStorage::const_XMLPos::operator * (  )  const [inline]

Definition at line 1503 of file xmlstorage.h.

01503 {return *_cur;}

XS_String XMLStorage::const_XMLPos::get ( const XS_String attr_name  )  const [inline]

attribute access

Definition at line 1506 of file xmlstorage.h.

Referenced by XMLStorage::read_option().

01507     {
01508         return _cur->get(attr_name);
01509     }

Here is the caller graph for this function:

template<typename T>
XS_String XMLStorage::const_XMLPos::get ( const T &  attr_name  )  const [inline]

C++ attribute access.

Definition at line 1512 of file xmlstorage.h.

01512 {return _cur->get(attr_name);}

bool XMLStorage::const_XMLPos::back (  )  [inline]

go back to previous position

Definition at line 1515 of file xmlstorage.h.

01516     {
01517         if (!_stack.empty()) {
01518             _cur = _stack.top();
01519             _stack.pop();
01520             return true;
01521         } else
01522             return false;
01523     }

bool XMLStorage::const_XMLPos::go_down (  )  [inline]

go down to first child

Definition at line 1526 of file xmlstorage.h.

01527     {
01528         const XMLNode* node = _cur->get_first_child();
01529 
01530         if (node) {
01531             go_to(node);
01532             return true;
01533         } else
01534             return false;
01535     }

bool XMLStorage::const_XMLPos::go_down ( const XS_String name,
int  n = 0 
) [inline]

search for child and go down

Definition at line 1538 of file xmlstorage.h.

01539     {
01540         XMLNode* node = _cur->find(name, n);
01541 
01542         if (node) {
01543             go_to(node);
01544             return true;
01545         } else
01546             return false;
01547     }

bool XMLStorage::const_XMLPos::go ( const char *  path  ) 

move XPath like to position in XML tree

const XS_String& XMLStorage::const_XMLPos::str (  )  const [inline]

Definition at line 1566 of file xmlstorage.h.

01566 {return *_cur;}

void XMLStorage::const_XMLPos::go_to ( const XMLNode child  )  [inline, protected]

go to specified node

Definition at line 1574 of file xmlstorage.h.

01575     {
01576         _stack.push(_cur);
01577         _cur = child;
01578     }


Field Documentation

const XMLNode* XMLStorage::const_XMLPos::_root [protected]

Definition at line 1569 of file xmlstorage.h.

const XMLNode* XMLStorage::const_XMLPos::_cur [protected]

Definition at line 1570 of file xmlstorage.h.

std::stack<const XMLNode*> XMLStorage::const_XMLPos::_stack [protected]

Definition at line 1571 of file xmlstorage.h.


The documentation for this struct was generated from the following file:
IBrowser Source Code Documentation
generated on 18.09.2008 by doxygen

Homepage