00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 00002 /* libe-book 00003 * Version: MPL 2.0 / LGPLv2.1+ 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 * Alternatively, the contents of this file may be used under the terms 00010 * of the GNU Lesser General Public License Version 2.1 or later 00011 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are 00012 * applicable instead of those above. 00013 * 00014 * For further information visit http://libebook.sourceforge.net 00015 */ 00016 00017 #ifndef IMPPARSER_H_INCLUDED 00018 #define IMPPARSER_H_INCLUDED 00019 00020 #include <boost/shared_ptr.hpp> 00021 00022 #include "IMPCollector.h" 00023 #include "IMPHeader.h" 00024 00025 class WPXDocumentInterface; 00026 class WPXInputStream; 00027 00028 namespace libebook 00029 { 00030 00031 class IMPParser 00032 { 00033 // disable copying 00034 IMPParser(const IMPParser &); 00035 IMPParser &operator=(const IMPParser &); 00036 00037 public: 00038 IMPParser(WPXInputStream *input, WPXDocumentInterface *document); 00039 00040 bool parse(); 00041 00042 private: 00043 void createTextStream(); 00044 00045 boost::shared_ptr<WPXInputStream> getFileStream(const char *name) const; 00046 00047 private: 00048 const IMPHeader m_header; 00049 WPXInputStream *const m_input; 00050 IMPCollector m_collector; 00051 boost::shared_ptr<WPXInputStream> m_resources; 00052 boost::shared_ptr<WPXInputStream> m_text; 00053 }; 00054 00055 } 00056 00057 #endif // IMPPARSER_H_INCLUDED 00058 00059 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */