fixed the topmost () bug, added getTextCollection function
[SXSI/XMLTree.git] / XMLTree.h
index 9b55617..f605286 100644 (file)
--- a/XMLTree.h
+++ b/XMLTree.h
 \r
 #ifndef XMLTREE_H_\r
 #define XMLTREE_H_\r
-\r
+#include "TextCollection/TextCollection.h"\r
 #include <stdio.h>\r
 #include <stdlib.h>\r
+#include <cstring>\r
 #include "bp.h"\r
-#include "TextCollection/TextCollection.h"\r
-using SXSI::TextCollection;\r
 #include <static_bitsequence.h>\r
 #include <alphabet_mapper.h>\r
 #include <static_sequence.h>\r
-\r
+using SXSI::TextCollection;\r
 \r
 \r
 // this constant is used to efficiently compute the child operation in the tree\r
@@ -334,9 +333,12 @@ public:
    /** GetText(d): returns the text corresponding to document with\r
     * id d. */\r
    uchar* GetText(DocID d) {\r
-      Text->GetText(d);\r
+      return Text->GetText(d);\r
    }\r
    \r
+   TextCollection *getTextCollection() {\r
+      return Text;\r
+   }\r
    /** Save: saves XML tree data structure to file. */\r
    void Save(unsigned char *filename);\r
       \r