-/*******************************************
- * SXSIStorageInterface.cpp
- * ------------------------
- *
- *
- * Author: Kim Nguyen
- * Date: 04/11/08
- */
-
-
-#include "SXSIStorageInterface.h"
-#include "Utils.h"
-
-SXSIStorageInterface::SXSIStorageInterface(int sf,bool iet,bool dtc)
-{
- tree = NULL;
- tb = new XMLTreeBuilder();
- tb ->OpenDocument(iet,sf,dtc);
-}
-
-SXSIStorageInterface::~SXSIStorageInterface()
-{
-}
-
-void SXSIStorageInterface::newChild(string name)
-{
- tb->NewOpenTag(name);
-}
-
-
-void SXSIStorageInterface::newText(string text)
-{
-
- tb->NewText(text);
-}
-
-
-void SXSIStorageInterface::nodeFinished(string name)
-{
- tb->NewClosingTag(name);
-
-}
-
- void SXSIStorageInterface::parsingFinished()
-{
-
- tree = tb->CloseDocument();
-
-}
-
-void *SXSIStorageInterface::returnDocument(){
-#ifdef DEBUG
- printStats();
-#endif
- return ((void *) tree);
-
-}
-
-void SXSIStorageInterface::printStats(){
- std::cerr << "Parsing stats : \n";
- std::cerr << _new_child << " calls to newOpenTag/newClosingTag\n";
- std::cerr << _new_text << " calls to newText\n";
- std::cerr << _new_empty_text << " calls to newEmptyText\n";
- std::cerr << _length_text << " bytes (=" << _length_text/1024 << "kb ) added to TextCollection\n";
- return;
-}