X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=XMLTree.h;h=d446ab122d2cd37cd0ef9b24c1d66e18e482008b;hb=3c8f8af6704ca98b36b503878058aa0619806dad;hp=7c08fcc78ec39faa4f09396260a81f9c67320c21;hpb=a0808cd570d8645798ae80287d2b4845ceea36a2;p=SXSI%2FXMLTree.git diff --git a/XMLTree.h b/XMLTree.h index 7c08fcc..d446ab1 100644 --- a/XMLTree.h +++ b/XMLTree.h @@ -87,6 +87,8 @@ class XMLTree { /** The texts in the XML document */ TextCollection *Text; + /** The texts in the XML document (cached for faster display) */ + vector CachedText; /** Flag indicating whether the whole data structure has been constructed or * not. If the value is true, you cannot add more texts, nodes, etc. */ @@ -202,6 +204,10 @@ public: * is none. */ treeNode TaggedDesc(treeNode x, TagType tag); + /** TaggedNext(x,tag): returns the first node tagged tag with larger + * preorder than x. Returns NULT if there is none. */ + treeNode TaggedNext(treeNode x, TagType tag); + /** TaggedPrec(x,tag): returns the first node tagged tag with smaller * preorder than x and not an ancestor of x. Returns NULLT if there * is none. */ @@ -211,7 +217,14 @@ public: * preorder than x and not in the subtree of x. Returns NULLT if there * is none. */ treeNode TaggedFoll(treeNode x, TagType tag); - + + /** TaggedFollowingSibling(x,tag) */ + treeNode TaggedFollowingSibling(treeNode x, TagType tag); + + /** TaggedAncestor(x, tag): returns the closest ancestor of x tagged + * tag. Return NULLT is there is none. */ + treeNode TaggedAncestor(treeNode x, TagType tag); + /** PrevText(x): returns the document identifier of the text to the left of * node x, or NULLT if x is the root node. */ DocID PrevText(treeNode x); @@ -386,6 +399,10 @@ public: uchar* GetText(DocID d) { return Text->GetText(d); } + + uchar* GetCachedText(DocID d) { + return (uchar*) (CachedText.at(d).c_str()); + } TextCollection *getTextCollection() { return Text;