IMPHeader.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* libe-book
3  * Version: MPL 2.0 / LGPLv2.1+
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Alternatively, the contents of this file may be used under the terms
10  * of the GNU Lesser General Public License Version 2.1 or later
11  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
12  * applicable instead of those above.
13  *
14  * For further information visit http://libebook.sourceforge.net
15  */
16 
17 #ifndef IMPHEADER_H_INCLUDED
18 #define IMPHEADER_H_INCLUDED
19 
20 #include <boost/shared_ptr.hpp>
21 
22 #include "IMPTypes.h"
23 
24 class WPXInputStream;
25 
26 namespace libebook
27 {
28 
29 class IMPHeader
30 {
31 public:
32  explicit IMPHeader(WPXInputStream *input);
33 
34  static boost::shared_ptr<IMPHeader> create(WPXInputStream *input);
35 
36  unsigned getVersion() const;
37  IMPColorMode getColorMode() const;
38  unsigned getFileCount() const;
39  bool getCompressed() const;
40  bool getEncrypted() const;
41  const IMPMetadata &getMetadata() const;
42 
43  unsigned getTOCOffset() const;
44 
45 private:
46  void readHeader(WPXInputStream *input);
47  void readBookProperties(WPXInputStream *input);
48 
49 private:
50  unsigned m_version;
52  unsigned m_files;
53  unsigned m_dirNameLength;
54  unsigned m_remainingBytes;
58 };
59 
60 }
61 
62 #endif // IMPHEADER_H_INCLUDED
63 
64 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IMPMetadata m_metadata
Definition: IMPHeader.h:57
const IMPMetadata & getMetadata() const
Definition: IMPHeader.cpp:105
Definition: IMPHeader.h:29
unsigned getVersion() const
Definition: IMPHeader.cpp:80
IMPHeader(WPXInputStream *input)
Definition: IMPHeader.cpp:51
IMPColorMode
Definition: IMPTypes.h:25
static boost::shared_ptr< IMPHeader > create(WPXInputStream *input)
Definition: IMPHeader.cpp:65
bool getCompressed() const
Definition: IMPHeader.cpp:95
unsigned m_remainingBytes
Definition: IMPHeader.h:54
bool m_encrypted
Definition: IMPHeader.h:56
Definition: IMPTypes.h:32
bool m_compressed
Definition: IMPHeader.h:55
void readHeader(WPXInputStream *input)
Definition: IMPHeader.cpp:115
unsigned m_dirNameLength
Definition: IMPHeader.h:53
bool getEncrypted() const
Definition: IMPHeader.cpp:100
void readBookProperties(WPXInputStream *input)
Definition: IMPHeader.cpp:163
unsigned m_version
Definition: IMPHeader.h:50
unsigned getTOCOffset() const
Definition: IMPHeader.cpp:110
unsigned getFileCount() const
Definition: IMPHeader.cpp:90
IMPColorMode getColorMode() const
Definition: IMPHeader.cpp:85
IMPColorMode m_colorMode
Definition: IMPHeader.h:51
unsigned m_files
Definition: IMPHeader.h:52

Generated for libe-book by doxygen 1.8.5