EBOOKXMLParser.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libe-book project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef EBOOKXMLPARSER_H_INCLUDED
00011 #define EBOOKXMLPARSER_H_INCLUDED
00012 
00013 #include "libebook_utils.h"
00014 
00015 namespace libebook
00016 {
00017 
00030 class EBOOKXMLParser
00031 {
00032   // disable copying
00033   EBOOKXMLParser(const EBOOKXMLParser &other);
00034   EBOOKXMLParser &operator=(const EBOOKXMLParser &other);
00035 
00036 public:
00037   explicit EBOOKXMLParser(const RVNGInputStreamPtr_t &input);
00038   virtual ~EBOOKXMLParser() = 0;
00039 
00040   void parse();
00041 
00048   virtual int getId(const char *name, const char *ns) const = 0;
00049 
00050   virtual void startElement(int id) = 0;
00051   virtual void endElement(int id) = 0;
00052   virtual void attribute(int id, const char *value) = 0;
00053 
00054   virtual void startElementByName(const char *name, const char *ns) = 0;
00055   virtual void endElementByName(const char *name, const char *ns) = 0;
00056   virtual void attributeByName(const char *name, const char *ns, const char *value) = 0;
00057 
00058   virtual void text(const char *value) = 0;
00059 
00060 private:
00061   const RVNGInputStreamPtr_t m_input;
00062 };
00063 
00064 }
00065 
00066 #endif // EBOOKXMLPARSER_H_INCLUDED
00067 
00068 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */