.
[SXSI/xpathcomp.git] / SXSIStorageInterface.cpp
1 /*******************************************
2  * SXSIStorageInterface.cpp
3  * ------------------------
4  *
5  * 
6  * Author: Kim Nguyen
7  * Date: 04/11/08
8  */
9
10
11 #include "SXSIStorageInterface.h"
12 #include "Utils.h"
13
14
15 SXSIStorageInterface::SXSIStorageInterface()
16 {
17   tree = new XMLTree();
18   tree->OpenDocument(true,64);
19 }
20
21 SXSIStorageInterface::~SXSIStorageInterface()
22 {
23 }
24
25 void SXSIStorageInterface::newChild(string name)
26
27   tree->NewOpenTag((unsigned char*) name.c_str());
28 }
29
30
31 void SXSIStorageInterface::newText(string text)
32 {
33   if (text.empty())
34     tree->NewEmptyText();
35   else 
36     tree->NewText((unsigned char*) text.c_str());  
37 }
38         
39
40
41 void SXSIStorageInterface::nodeFinished(string name)
42 {  
43   tree->NewClosingTag((unsigned char*) name.c_str());
44  }            
45               
46   void SXSIStorageInterface::parsingFinished()
47 {
48    tree->CloseDocument();
49         
50 }
51
52 void *SXSIStorageInterface::returnDocument(){
53
54   return ((void *) tree);
55   
56 }