SoftBookHeader.h Source File documentation

SoftBookHeader.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libe-book project.
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
10 #ifndef SOFTBOOKHEADER_H_INCLUDED
11 #define SOFTBOOKHEADER_H_INCLUDED
12
13 #include "SoftBookTypes.h"
14
15 namespace libebook
16 {
17
18 class SoftBookHeader
19 {
20 public:
21 explicit SoftBookHeader(librevenge::RVNGInputStream *input);
22
23 static std::shared_ptr<SoftBookHeader> create(librevenge::RVNGInputStream *input);
24
25 unsigned getVersion() const;
26 SoftBookColorMode getColorMode() const;
27 unsigned getFileCount() const;
28 bool getCompressed() const;
29 bool getEncrypted() const;
30 const SoftBookMetadata &getMetadata() const;
31
32 unsigned getTOCOffset() const;
33
34 private:
35 void readHeader(librevenge::RVNGInputStream *input);
36 void readBookProperties(librevenge::RVNGInputStream *input);
37
38 private:
39 unsigned m_version;
40 SoftBookColorMode m_colorMode;
41 unsigned m_files;
42 unsigned m_dirNameLength;
43 unsigned m_remainingBytes;
44 bool m_compressed;
45 bool m_encrypted;
46 SoftBookMetadata m_metadata;
47 };
48
49 }
50
51 #endif // SOFTBOOKHEADER_H_INCLUDED
52
53 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
m_metadata
librevenge::RVNGPropertyList m_metadata
Definition: FictionBook2Parser.cpp:78
libebook::SoftBookMetadata::middleName
std::string middleName
Definition: SoftBookTypes.h:34
libebook::SoftBookHeader::m_dirNameLength
unsigned m_dirNameLength
Definition: SoftBookHeader.h:42
libebook::SoftBookHeader::m_colorMode
SoftBookColorMode m_colorMode
Definition: SoftBookHeader.h:40
libebook::SoftBookMetadata::id
std::string id
Definition: SoftBookTypes.h:29
libebook::SoftBookHeader::m_version
unsigned m_version
Definition: SoftBookHeader.h:39
libebook::SoftBookMetadata::lastName
std::string lastName
Definition: SoftBookTypes.h:33
libebook::SoftBookMetadata::title
std::string title
Definition: SoftBookTypes.h:32
libebook::SoftBookHeader::m_remainingBytes
unsigned m_remainingBytes
Definition: SoftBookHeader.h:43
libebook::SoftBookHeader::m_compressed
bool m_compressed
Definition: SoftBookHeader.h:44
libebook
Definition: BBeBCollector.cpp:18
libebook::SoftBookHeader
Definition: SoftBookHeader.h:18
libebook::SoftBookHeader::getCompressed
bool getCompressed() const
Definition: SoftBookHeader.cpp:88
libebook::SoftBookHeader::m_files
unsigned m_files
Definition: SoftBookHeader.h:41
libebook_utils.h
libebook::SoftBookHeader::getEncrypted
bool getEncrypted() const
Definition: SoftBookHeader.cpp:93
libebook::SoftBookHeader::readBookProperties
void readBookProperties(librevenge::RVNGInputStream *input)
Definition: SoftBookHeader.cpp:156
libebook::SoftBookHeader::getFileCount
unsigned getFileCount() const
Definition: SoftBookHeader.cpp:83
libebook::SoftBookHeader::getMetadata
const SoftBookMetadata & getMetadata() const
Definition: SoftBookHeader.cpp:98
libebook::EPubToken::encryption
Definition: EPubToken.h:35
libebook::SoftBookColorMode
SoftBookColorMode
Definition: SoftBookTypes.h:18
libebook::SoftBookHeader::m_metadata
SoftBookMetadata m_metadata
Definition: SoftBookHeader.h:46
libebook::SoftBookHeader::create
static std::shared_ptr< SoftBookHeader > create(librevenge::RVNGInputStream *input)
Definition: SoftBookHeader.cpp:58
libebook::SoftBookHeader::m_encrypted
bool m_encrypted
Definition: SoftBookHeader.h:45
libebook::SoftBookHeader::getColorMode
SoftBookColorMode getColorMode() const
Definition: SoftBookHeader.cpp:78
libebook::SoftBookMetadata::subcategory
std::string subcategory
Definition: SoftBookTypes.h:31
libebook::SoftBookMetadata::firstName
std::string firstName
Definition: SoftBookTypes.h:35
libebook::SOFTBOOK_COLOR_MODE_UNKNOWN
Definition: SoftBookTypes.h:20
libebook::EBOOKHTMLToken::input
Definition: EBOOKHTMLToken.h:89
libebook::readU16
uint16_t readU16(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libebook_utils.cpp:57
m_version
unsigned m_version
Definition: PDBParser.cpp:33
libebook::SoftBookHeader::getVersion
unsigned getVersion() const
Definition: SoftBookHeader.cpp:73
libebook::SoftBookHeader::readHeader
void readHeader(librevenge::RVNGInputStream *input)
Definition: SoftBookHeader.cpp:108
libebook::readU32
uint32_t readU32(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libebook_utils.cpp:73
libebook::EBOOKHTMLToken::header
Definition: EBOOKHTMLToken.h:82
SoftBookTypes.h
EBOOK_DEBUG_MSG
#define EBOOK_DEBUG_MSG(M)
Definition: libebook_utils.h:44
libebook::readNBytes
const unsigned char * readNBytes(librevenge::RVNGInputStream *const input, const unsigned long numBytes)
Definition: libebook_utils.cpp:105
libebook::SoftBookHeader::getTOCOffset
unsigned getTOCOffset() const
Definition: SoftBookHeader.cpp:103
libebook::SoftBookMetadata
Definition: SoftBookTypes.h:25
libebook::SoftBookHeader::SoftBookHeader
SoftBookHeader(librevenge::RVNGInputStream *input)
Definition: SoftBookHeader.cpp:44
SoftBookHeader.h
libebook::skip
void skip(librevenge::RVNGInputStream *input, unsigned long numBytes)
Definition: libebook_utils.cpp:145
libebook::SoftBookMetadata::category
std::string category
Definition: SoftBookTypes.h:30
libebook::readCString
string readCString(librevenge::RVNGInputStream *input)
Definition: libebook_utils.cpp:118