EBOOKOPFParser.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 EBOOKOPFPARSER_H_INCLUDED
00011 #define EBOOKOPFPARSER_H_INCLUDED
00012 
00013 #include <librevenge/librevenge.h>
00014 
00015 #include "libebook_utils.h"
00016 
00017 namespace libebook
00018 {
00019 
00020 class EBOOKOPFParser
00021 {
00022   // disable copying
00023   EBOOKOPFParser(const EBOOKOPFParser &other);
00024   EBOOKOPFParser &operator=(const EBOOKOPFParser &other);
00025 
00026 public:
00027   enum Type
00028   {
00029     TYPE_OEB,
00030     TYPE_EPUB,
00031     TYPE_EPUB3
00032   };
00033 
00034 public:
00035   EBOOKOPFParser(const RVNGInputStreamPtr_t &input, const RVNGInputStreamPtr_t &package, Type type, librevenge::RVNGTextInterface *document);
00036 
00037   void parse();
00038 
00039   static bool findOPFStream(const RVNGInputStreamPtr_t &package, unsigned &stream);
00040 
00041 private:
00042   const RVNGInputStreamPtr_t getStream(const char *name) const;
00043 
00044 private:
00045   const RVNGInputStreamPtr_t m_input;
00046   const RVNGInputStreamPtr_t m_package;
00047   const Type m_type;
00048   librevenge::RVNGTextInterface *const m_document;
00049 };
00050 
00051 }
00052 
00053 #endif // EBOOKOPFPARSER_H_INCLUDED
00054 
00055 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */