From: kim Date: Tue, 25 Nov 2008 04:04:09 +0000 (+0000) Subject: Missing files in the previous commit. X-Git-Url: http://git.nguyen.vg/gitweb/?a=commitdiff_plain;h=9c9764f2217221c6b2282d353233da958955cb97;p=SXSI%2Fxpathcomp.git Missing files in the previous commit. git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/xpathcomp@14 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- diff --git a/SXSIStorageInterface.cpp b/SXSIStorageInterface.cpp new file mode 100644 index 0000000..dcd3c30 --- /dev/null +++ b/SXSIStorageInterface.cpp @@ -0,0 +1,65 @@ +/******************************************* + * SXSIStorageInterface.cpp + * ------------------------ + * + * + * Author: Kim Nguyen + * Date: 04/11/08 + */ + + +#include "SXSIStorageInterface.h" +#include "Utils.h" + + +SXSIStorageInterface::SXSIStorageInterface() +{ + tree = new XMLTree(); + tree->OpenDocument(true,1); +} + +SXSIStorageInterface::~SXSIStorageInterface() +{ +} + +void SXSIStorageInterface::newChild(string name) +{ + + DPRINT("enter NewChild" << name << "\n") + tree->NewOpenTag((unsigned char*) name.c_str()); + DPRINT("leave NewChild" << name << "\n") +} + + +void SXSIStorageInterface::newText(string text) +{ + DPRINT("enter NewText" << text << "\n") + if (text.empty()) + tree->NewEmptyText(); + else + tree->NewText((unsigned char*) text.c_str()); + DPRINT("leave NewText" << text << "\n") +} + + + +void SXSIStorageInterface::nodeFinished(string name) +{ + DPRINT("enter NodeFinished" << name << "\n") + tree->NewClosingTag((unsigned char*) name.c_str()); + DPRINT("leave NodeFinished" << name << "\n") +} + + void SXSIStorageInterface::parsingFinished() +{ + DPRINT("enter parsingFinished\n") + tree->CloseDocument(); + DPRINT("leave parsingFinished\n") + +} + +void *SXSIStorageInterface::returnDocument(){ + + return ((void *) tree); + +} diff --git a/SXSIStorageInterface.h b/SXSIStorageInterface.h new file mode 100644 index 0000000..8f09a48 --- /dev/null +++ b/SXSIStorageInterface.h @@ -0,0 +1,34 @@ +/***************************************** + * SXSIStorageInterface.h + * ------------------------ + * Header file for an SXSI Storage Interface + * + * Author: Kim Nguyen + * Date: 25/11/08 + */ + +#ifndef SXSISTORAGEINTERFACE_H_ +#define SXSISTORAGEINTERFACE_H_ + +#include "XMLTree.h" +#include "StorageInterface.h" + + +using namespace std; + +class SXSIStorageInterface: public StorageInterface +{ + public: + SXSIStorageInterface(); + virtual ~SXSIStorageInterface(); + virtual void newChild(string name); + virtual void newText(string text); + virtual void nodeFinished(string name); + virtual void parsingFinished(); + virtual void* returnDocument(); + + private: + XMLTree* tree; +}; + +#endif /*SXSISTORAGEINTERFACE_H_*/