Adding support for building wavelet trees using uchar arrays
[SXSI/XMLTree.git] / XMLTree.h
index 67ffd6e..3bfb7a4 100644 (file)
--- a/XMLTree.h
+++ b/XMLTree.h
@@ -84,6 +84,8 @@ class XMLTree {
                      \r
    /** Tag sequence represented with a data structure for rank and select */\r
    static_sequence *Tags;\r
+        uint * tags_fix;\r
+        uint tags_blen, tags_len;\r
 \r
    /** The texts in the XML document */\r
    TextCollection *Text;\r
@@ -217,7 +219,14 @@ public:
     * preorder than x and not in the subtree of x. Returns NULLT if there \r
     * is none. */\r
    treeNode TaggedFoll(treeNode x, TagType tag);\r
-   \r
+  \r
+   /** TaggedFollowingSibling(x,tag) */\r
+   treeNode TaggedFollowingSibling(treeNode x, TagType tag);\r
+\r
+   /** TaggedAncestor(x, tag): returns the closest ancestor of x tagged \r
+     * tag. Return NULLT is there is none. */\r
+   treeNode TaggedAncestor(treeNode x, TagType tag);\r
\r
    /** PrevText(x): returns the document identifier of the text to the left of \r
     * node x, or NULLT if x is the root node. */\r
    DocID PrevText(treeNode x);\r
@@ -394,7 +403,9 @@ public:
    }\r
 \r
    uchar* GetCachedText(DocID d) {\r
-     return (uchar*) (CachedText.at(d).c_str());\r
+     uchar * str = (uchar*) calloc(sizeof(char),(CachedText.at(d).size() + 1));\r
+     strcpy((char*) str,(const char*) CachedText.at(d).c_str());\r
+     return (uchar*) (str);\r
    }\r
    \r
    TextCollection *getTextCollection() {\r