RBHeader.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 RBHEADER_H_INCLUDED
11 #define RBHEADER_H_INCLUDED
12 
13 #include <deque>
14 #include <string>
15 
16 #include "libebook_utils.h"
17 
18 namespace libebook
19 {
20 
21 class RBHeader
22 {
23 public:
24  enum Flag
25  {
27  FLAG_INFO_PAGE = 1 << 1,
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 
44 public:
45  explicit RBHeader(const RVNGInputStreamPtr_t &input);
46 
47  unsigned getInfoID() const;
48  const Directory_t &getDirectory() const;
49 
50 private:
53 
54 private:
55  unsigned m_version;
56  unsigned m_tocOffset;
57  unsigned m_length;
58  Directory_t m_dir;
59  unsigned m_info;
60 };
61 
62 }
63 
64 #endif // RBHEADER_H_INCLUDED
65 
66 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition: RBHeader.h:26
Definition: EBOOKHTMLToken.h:91
Directory_t m_dir
Definition: RBHeader.h:58
boost::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libebook_utils.h:82
std::deque< Entry > Directory_t
Definition: RBHeader.h:42
unsigned m_tocOffset
Definition: RBHeader.h:56
Definition: RBHeader.h:28
Definition: RBHeader.h:29
RBHeader(const RVNGInputStreamPtr_t &input)
Definition: RBHeader.cpp:44
Flag
Definition: RBHeader.h:24
unsigned m_info
Definition: RBHeader.h:59
std::string name
Definition: RBHeader.h:34
unsigned m_length
Definition: RBHeader.h:57
unsigned getInfoID() const
Definition: RBHeader.cpp:58
Definition: RBHeader.h:21
void readDirectory(const RVNGInputStreamPtr_t &input)
Definition: RBHeader.cpp:92
Definition: RBHeader.h:27
Entry()
Definition: RBHeader.cpp:36
unsigned length
Definition: RBHeader.h:35
void readHeader(const RVNGInputStreamPtr_t &input)
Definition: RBHeader.cpp:68
Definition: CHMParser.cpp:20
Definition: RBHeader.h:32
unsigned flags
Definition: RBHeader.h:37
const Directory_t & getDirectory() const
Definition: RBHeader.cpp:63
unsigned m_version
Definition: RBHeader.h:55
unsigned offset
Definition: RBHeader.h:36

Generated for libe-book by doxygen 1.8.8