X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=SXSIStorageInterface.cpp;h=2594bd2595aab552d37845d02c1612cfff2ba3fc;hb=04639fe524ee20f7f84c8b08387312d714c9bd56;hp=6fe4883297339596a161d7b5a46499c0c0ddfa6f;hpb=63ca35af9ef5c0b18b3d3217536f3353f77f5465;p=SXSI%2Fxpathcomp.git diff --git a/SXSIStorageInterface.cpp b/SXSIStorageInterface.cpp index 6fe4883..2594bd2 100644 --- a/SXSIStorageInterface.cpp +++ b/SXSIStorageInterface.cpp @@ -11,11 +11,11 @@ #include "SXSIStorageInterface.h" #include "Utils.h" - SXSIStorageInterface::SXSIStorageInterface(int sf,bool iet,bool dtc) { - tree = new XMLTree(); - tree->OpenDocument(iet,sf,dtc); + tree = NULL; + tb = new XMLTreeBuilder(); + tb ->OpenDocument(iet,sf,dtc); } SXSIStorageInterface::~SXSIStorageInterface() @@ -24,35 +24,27 @@ SXSIStorageInterface::~SXSIStorageInterface() void SXSIStorageInterface::newChild(string name) { - _new_child++; - tree->NewOpenTag((unsigned char*) name.c_str()); + tb->NewOpenTag(name); } void SXSIStorageInterface::newText(string text) { - if (text.empty()) { - _new_empty_text++; - tree->NewEmptyText(); - } - else { - _new_text++; - _length_text += text.size(); - tree->NewText((unsigned char*) text.c_str()); - } + tb->NewText(text); } void SXSIStorageInterface::nodeFinished(string name) { - tree->NewClosingTag((unsigned char*) name.c_str()); - } + tb->NewClosingTag(name); + +} void SXSIStorageInterface::parsingFinished() { - tree->CloseDocument(); + tree = tb->CloseDocument(); } @@ -63,6 +55,7 @@ void *SXSIStorageInterface::returnDocument(){ return ((void *) tree); } + void SXSIStorageInterface::printStats(){ std::cerr << "Parsing stats : \n"; std::cerr << _new_child << " calls to newOpenTag/newClosingTag\n";