IMPHeader.h
Go to the documentation of this file.
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 IMPHEADER_H_INCLUDED
00018 #define IMPHEADER_H_INCLUDED
00019 
00020 #include <boost/shared_ptr.hpp>
00021 
00022 #include "IMPTypes.h"
00023 
00024 class WPXInputStream;
00025 
00026 namespace libebook
00027 {
00028 
00029 class IMPHeader
00030 {
00031 public:
00032   explicit IMPHeader(WPXInputStream *input);
00033 
00034   static boost::shared_ptr<IMPHeader> create(WPXInputStream *input);
00035 
00036   unsigned getVersion() const;
00037   IMPColorMode getColorMode() const;
00038   unsigned getFileCount() const;
00039   bool getCompressed() const;
00040   bool getEncrypted() const;
00041   const IMPMetadata &getMetadata() const;
00042 
00043   unsigned getTOCOffset() const;
00044 
00045 private:
00046   void readHeader(WPXInputStream *input);
00047   void readBookProperties(WPXInputStream *input);
00048 
00049 private:
00050   unsigned m_version;
00051   IMPColorMode m_colorMode;
00052   unsigned m_files;
00053   unsigned m_dirNameLength;
00054   unsigned m_remainingBytes;
00055   bool m_compressed;
00056   bool m_encrypted;
00057   IMPMetadata m_metadata;
00058 };
00059 
00060 }
00061 
00062 #endif // IMPHEADER_H_INCLUDED
00063 
00064 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */