1 /**************************************
4 * Header file for the shredder routine that invokes the XML parser and
5 * calls the appropriate construction methods of the storage interface in
6 * correspondence with received parsing events.
8 * Author: Greg Leighton
12 #ifndef XMLDOCSHREDDER_H_
13 #define XMLDOCSHREDDER_H_
15 #include <libxml++/libxml++.h>
16 #include <libxml++/parsers/textreader.h>
18 #include <unordered_map>
19 #include "StorageInterface.h"
22 using namespace xmlpp;
23 /* For Hashmap. Seems fairly well supported */
24 using namespace __gnu_cxx;
26 typedef pair<int,string> cons_str;
27 typedef pair<string,int> cons_int;
32 XMLDocShredder(const string inFileName);
33 XMLDocShredder(const unsigned char * data, TextReader::size_type size);
34 virtual ~XMLDocShredder();
35 virtual void processStartElement();
36 virtual void processEndElement();
37 virtual void processPCDATA();
38 virtual void processAttributes();
39 virtual void processSignificantWhitespace();
40 virtual void processStartDocument(const string docName);
41 virtual void processEndDocument();
42 virtual void processComment();
43 virtual void processProcessingInstruction();
44 virtual void processDocTypeDeclaration();
45 virtual void processUnknownNodeType();
46 virtual void processCDATASection();
49 StorageInterface *storageIfc_;
58 #endif /*XMLDOCSHREDDER_H_*/