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 IMPPARSER_H_INCLUDED 00011 #define IMPPARSER_H_INCLUDED 00012 00013 #include <boost/shared_ptr.hpp> 00014 00015 #include "IMPCollector.h" 00016 #include "IMPHeader.h" 00017 00018 00019 namespace libebook 00020 { 00021 00022 class IMPParser 00023 { 00024 // disable copying 00025 IMPParser(const IMPParser &); 00026 IMPParser &operator=(const IMPParser &); 00027 00028 public: 00029 IMPParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document); 00030 00031 bool parse(); 00032 00033 private: 00034 void createTextStream(); 00035 00036 boost::shared_ptr<librevenge::RVNGInputStream> getFileStream(const char *name) const; 00037 00038 private: 00039 const IMPHeader m_header; 00040 librevenge::RVNGInputStream *const m_input; 00041 IMPCollector m_collector; 00042 boost::shared_ptr<librevenge::RVNGInputStream> m_resources; 00043 boost::shared_ptr<librevenge::RVNGInputStream> m_text; 00044 }; 00045 00046 } 00047 00048 #endif // IMPPARSER_H_INCLUDED 00049 00050 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */