GrovePos — GrovePos denotes a position in the XML tree (grove).
class GrovePos {
public:
enum Type { UNKNOWN_POS, ELEMENT_POS, TEXT_POS };
// construct/copy/destruct
GrovePos();
GrovePos(const GroveNode &);
GrovePos(const GroveNode &, const GroveNode &);
GrovePos(const GroveText &, long);
GrovePos(const SString &, const GroveNode &);
// public member functions
SString asString() const;
bool isNull() const;
Type type() const;
GroveNode node() const;
GroveNode before() const;
GroveText text() const;
long idx() const;
GroveErs getErs() const;
void dump() const;
};There are two kinds of GrovePos: TEXT_POS and ELEMENT_POS. For TEXT_POS, position consists of reference to text node and offset in text; for ELEMENT_POS, position consists of parent node and "before" node (position in tree is assumed just before "before" node; of before node is NULL, then position is right after the last child of the parent node).
GrovePos construct/copy/destructConstruct NULL GrovePos.
Constructs ELEMENT_POS.
Constructs ELEMENT_POS.
Constructs TEXT_POS (idx means offset in text, starting from 0)
Constructs GrovePos from text representation (path starting at root)
GrovePos public member functionsSString asString() const;
Returns text representation of GrovePos (like "xpath path")
Returns true if position is not initialized.
Return type of grove position, see Type enum.
GroveNode node() const;
These are returned for ELEMENT_POS.
GroveNode before() const;
These are returned for ELEMENT_POS.
GroveText text() const;
These are returned for TEXT_POS.
These are returned for TEXT_POS.
GroveErs getErs() const;
Get current entity context for this position.
Dump GrovePos.