RocketEBookHeader.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 * For further information visit http://libebook.sourceforge.net
8 */
9
10#ifndef ROCKETEBOOKHEADER_H_INCLUDED
11#define ROCKETEBOOKHEADER_H_INCLUDED
12
13#include <deque>
14#include <string>
15
16#include "libebook_utils.h"
17
18namespace libebook
19{
20
22{
23public:
24 enum Flag
25 {
28 FLAG_RESERVED = 1 << 2,
29 FLAG_DEFLATED = 1 << 3
30 };
31
32 struct Entry
33 {
34 std::string name;
35 unsigned length;
36 unsigned offset;
37 unsigned flags;
38
39 Entry();
40 };
41
42 typedef std::deque<Entry> Directory_t;
43
44public:
45 explicit RocketEBookHeader(const RVNGInputStreamPtr_t &input);
46
47 unsigned getInfoID() const;
48 const Directory_t &getDirectory() const;
49
50private:
51 void readHeader(const RVNGInputStreamPtr_t &input);
52 void readDirectory(const RVNGInputStreamPtr_t &input);
53
54private:
55 unsigned m_version;
56 unsigned m_tocOffset;
57 unsigned m_length;
59 unsigned m_info;
60};
61
62}
63
64#endif // ROCKETEBOOKHEADER_H_INCLUDED
65
66/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition: RocketEBookHeader.h:22
unsigned m_length
Definition: RocketEBookHeader.h:57
unsigned m_tocOffset
Definition: RocketEBookHeader.h:56
void readDirectory(const RVNGInputStreamPtr_t &input)
Definition: RocketEBookHeader.cpp:94
unsigned m_info
Definition: RocketEBookHeader.h:59
std::deque< Entry > Directory_t
Definition: RocketEBookHeader.h:42
unsigned m_version
Definition: RocketEBookHeader.h:55
void readHeader(const RVNGInputStreamPtr_t &input)
Definition: RocketEBookHeader.cpp:70
Directory_t m_dir
Definition: RocketEBookHeader.h:58
const Directory_t & getDirectory() const
Definition: RocketEBookHeader.cpp:65
Flag
Definition: RocketEBookHeader.h:25
@ FLAG_INFO_PAGE
Definition: RocketEBookHeader.h:27
@ FLAG_RESERVED
Definition: RocketEBookHeader.h:28
@ FLAG_DEFLATED
Definition: RocketEBookHeader.h:29
@ FLAG_ENCRYPTED
Definition: RocketEBookHeader.h:26
unsigned getInfoID() const
Definition: RocketEBookHeader.cpp:60
Definition: BBeBCollector.cpp:19
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libebook_utils.h:54
Definition: RocketEBookHeader.h:33
unsigned length
Definition: RocketEBookHeader.h:35
std::string name
Definition: RocketEBookHeader.h:34
unsigned offset
Definition: RocketEBookHeader.h:36
unsigned flags
Definition: RocketEBookHeader.h:37
Entry()
Definition: RocketEBookHeader.cpp:38

Generated for libe-book by doxygen 1.9.5