X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=XMLTree.h;h=ea7b77820f39aacd286b342da1c2af4ce8823062;hb=9c696a1b1a7034794b3768e4e1e40db86e87ebbb;hp=d0a5c731db5f0faba188c26021caf95e1fcee004;hpb=b9205dab05e219c2ac3ce7cf5fe0107267d60535;p=SXSI%2FXMLTree.git diff --git a/XMLTree.h b/XMLTree.h index d0a5c73..ea7b778 100644 --- a/XMLTree.h +++ b/XMLTree.h @@ -162,6 +162,21 @@ class XMLTree { fputs(buffer->c_str(), fp); buffer->clear(); } + + size_t myfprintf(const char* s, FILE * fp){ + if (s == NULL) + return 0; + size_t i = buffer->size(); + buffer->append(s); + size_t j = buffer->size(); + if (buffer->size() >= 100000){ + fputs(buffer->c_str(),fp); + buffer->clear(); + }; + return (j-i); + } + + void PrintNode(treeNode n, int fd); /** Data structure constructors */ XMLTree(){ buffer = 0;}; @@ -458,7 +473,7 @@ public: uchar* GetText(DocID d) { uchar * s = Text->GetText(d); - return (s[0] == 1 ? (uchar*)"" : s); + return (s[0] == 1 ? (s+1) : s); } /** GetText(i, j): returns the texts corresponding to documents with