Inheritance diagram for DSRTreeNodeCursor:
Public Member Functions | |
DSRTreeNodeCursor () | |
default constructor | |
DSRTreeNodeCursor (const DSRTreeNodeCursor &cursor) | |
copy constructor | |
DSRTreeNodeCursor (DSRTreeNode *node) | |
constructor | |
virtual | ~DSRTreeNodeCursor () |
destructor | |
DSRTreeNodeCursor & | operator= (const DSRTreeNodeCursor &cursor) |
assignment operator | |
DSRTreeNodeCursor & | operator= (DSRTreeNode *node) |
assignment operator | |
virtual void | clear () |
clear all member variables | |
virtual OFBool | isValid () const |
check whether cursor currently points to a valid node | |
DSRTreeNode * | getNode () const |
get pointer to current node | |
const DSRTreeNode * | getParentNode () |
get pointer to parent node. | |
const DSRTreeNode * | getNextNode () const |
get pointer to next node. | |
size_t | gotoPrevious () |
goto previous node on the same level | |
size_t | gotoNext () |
goto next node on the same level | |
size_t | goUp () |
goto parent node (one level up) | |
size_t | goDown () |
goto first child node (one level down) | |
size_t | iterate (const OFBool searchIntoSub=OFTrue) |
iterate over all nodes. | |
size_t | gotoNode (const size_t searchID) |
set cursor to specified node. | |
size_t | gotoNode (const OFString &position, const char separator= '.') |
set cursor to specified node. | |
size_t | getNodeID () const |
get current node ID. | |
size_t | getLevel () const |
get current level. | |
const OFString & | getPosition (OFString &position, const char separator= '.') const |
get position string of the current node. | |
Protected Member Functions | |
void | clearNodeCursorStack () |
clear the internal node cursor stack | |
size_t | setCursor (DSRTreeNode *node) |
set cursor to specified node. | |
Protected Attributes | |
DSRTreeNode * | NodeCursor |
pointer current node | |
OFStack< DSRTreeNodePointer > | NodeCursorStack |
stack of node pointers. Used to store the cursor position of upper levels. | |
size_t | Position |
current position within the current level | |
OFList< size_t > | PositionList |
list of position counters in upper levels |
Definition at line 62 of file dsrtncsr.h.
DSRTreeNodeCursor::DSRTreeNodeCursor | ( | const DSRTreeNodeCursor & | cursor | ) |
copy constructor
cursor | object to be copied |
DSRTreeNodeCursor::DSRTreeNodeCursor | ( | DSRTreeNode * | node | ) |
constructor
node | pointer tree node used to initialize the cursor (set to this node) |
DSRTreeNodeCursor& DSRTreeNodeCursor::operator= | ( | const DSRTreeNodeCursor & | cursor | ) |
assignment operator
cursor | object to be copied |
DSRTreeNodeCursor& DSRTreeNodeCursor::operator= | ( | DSRTreeNode * | node | ) |
assignment operator
node | node to which the cursor should be set |
virtual OFBool DSRTreeNodeCursor::isValid | ( | ) | const [virtual] |
check whether cursor currently points to a valid node
Reimplemented in DSRDocumentTree.
DSRTreeNode* DSRTreeNodeCursor::getNode | ( | ) | const [inline] |
get pointer to current node
Definition at line 109 of file dsrtncsr.h.
References NodeCursor.
const DSRTreeNode* DSRTreeNodeCursor::getParentNode | ( | ) |
get pointer to parent node.
Used to have a lookup to the parent node without changing the cursor.
const DSRTreeNode* DSRTreeNodeCursor::getNextNode | ( | ) | const |
get pointer to next node.
Used to have a lookup to the next node without changing the cursor.
size_t DSRTreeNodeCursor::gotoPrevious | ( | ) |
goto previous node on the same level
size_t DSRTreeNodeCursor::gotoNext | ( | ) |
goto next node on the same level
size_t DSRTreeNodeCursor::goUp | ( | ) |
goto parent node (one level up)
size_t DSRTreeNodeCursor::goDown | ( | ) |
goto first child node (one level down)
size_t DSRTreeNodeCursor::iterate | ( | const OFBool | searchIntoSub = OFTrue |
) |
iterate over all nodes.
Starts from current position!
searchIntoSub | flag indicating whether to search into sub-trees ("deep search") or on the current level only |
size_t DSRTreeNodeCursor::gotoNode | ( | const size_t | searchID | ) |
set cursor to specified node.
Starts from current position!
searchID | ID of the node to set the cursor to |
size_t DSRTreeNodeCursor::gotoNode | ( | const OFString & | position, | |
const char | separator = '.' | |||
) |
set cursor to specified node.
Starts from current position!
position | position string of the node to set the cursor to. (the format is e.g. "1.2.3" for the third child of the second child of the first node - see getPosition()). | |
separator | character used to separate the figures (default: '.') |
size_t DSRTreeNodeCursor::getNodeID | ( | ) | const |
get current node ID.
The node ID uniquely identifies a content item in the document tree. Most of the navigation methods above do return this ID too.
size_t DSRTreeNodeCursor::getLevel | ( | ) | const |
get current level.
The level starts with 1 for the root node, then 2 for its child nodes, etc.
const OFString& DSRTreeNodeCursor::getPosition | ( | OFString & | position, | |
const char | separator = '.' | |||
) | const |
get position string of the current node.
Specifies the position of each node by means of a dot separated string of position counters. The first figure of this string specifies the position within the first level (e.g. "1"), the second one the position in the second level (e.g. "2"), the third one the position in the third level (e.g. "3"), etc. A position string of "1.2.3" would, therefore, point to the third child of the second child of the first node.
position | variable where the position string should be stored | |
separator | character used to separate the figures (default: '.') |
size_t DSRTreeNodeCursor::setCursor | ( | DSRTreeNode * | node | ) | [protected] |
set cursor to specified node.
Clears the internal position list/stack and sets the position counter to 1.
node | node to which the cursor should be set |