Missing files in the previous commit.
authorkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Tue, 25 Nov 2008 04:04:09 +0000 (04:04 +0000)
committerkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Tue, 25 Nov 2008 04:04:09 +0000 (04:04 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/xpathcomp@14 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

SXSIStorageInterface.cpp [new file with mode: 0644]
SXSIStorageInterface.h [new file with mode: 0644]

diff --git a/SXSIStorageInterface.cpp b/SXSIStorageInterface.cpp
new file mode 100644 (file)
index 0000000..dcd3c30
--- /dev/null
@@ -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 (file)
index 0000000..8f09a48
--- /dev/null
@@ -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_*/