IBR-DTNSuite  0.8
ibrcommon/ibrcommon/xml/XMLStreamReader.h
Go to the documentation of this file.
00001 /*
00002  * XMLStreamReader.h
00003  *
00004  *  Created on: 01.06.2011
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef XMLSTREAMREADER_H_
00009 #define XMLSTREAMREADER_H_
00010 
00011 #include "ibrcommon/xml/XMLStreamHandler.h"
00012 #include <libxml/parser.h>
00013 #include <libxml/encoding.h>
00014 #include <iostream>
00015 
00016 namespace ibrcommon
00017 {
00018         class XMLStreamReader
00019         {
00020         public:
00021                 XMLStreamReader(XMLStreamHandler &callback);
00022                 virtual ~XMLStreamReader();
00023                 static void __startDocument(void *data);
00024                 static void __endDocument(void *data);
00025                 static void __startElement(void *data, const xmlChar *fullname, const xmlChar **ats);
00026                 static void __endElement(void *data, const xmlChar *fullname);
00027                 static void __characters(void *data, const xmlChar *ch, int len);
00028                 void parse(std::istream &stream);
00029 
00030         private:
00031                 XMLStreamHandler &_callback;
00032         };
00033 }
00034 
00035 #endif /* XMLSTREAMREADER_H_ */