SoftBookLZSSStream.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 SOFTBOOKLZSSSTREAM_H_INCLUDED
11 #define SOFTBOOKLZSSSTREAM_H_INCLUDED
12 
13 #include <memory>
14 
15 #include <librevenge-stream/librevenge-stream.h>
16 
17 namespace libebook
18 {
19 
20 class SoftBookLZSSStream : public librevenge::RVNGInputStream
21 {
22 // disable copying
25 
26 public:
28  {
29  unsigned offsetBits;
30  unsigned lengthBits;
32  unsigned fillPos;
33  char fillChar;
35  bool bigEndian;
36 
37  Configuration();
38  };
39 
40 public:
41  explicit SoftBookLZSSStream(librevenge::RVNGInputStream *stream, const Configuration &configuration = Configuration());
42  ~SoftBookLZSSStream() override;
43 
44  bool isStructured() override;
45  unsigned subStreamCount() override;
46  const char *subStreamName(unsigned id) override;
47  bool existsSubStream(const char *name) override;
48  librevenge::RVNGInputStream *getSubStreamByName(const char *name) override;
49  RVNGInputStream *getSubStreamById(unsigned id) override;
50 
51  const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) override;
52  int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override;
53  long tell() override;
54  bool isEnd() override;
55 
56 private:
57  std::unique_ptr<librevenge::RVNGInputStream> m_stream;
58 };
59 
60 }
61 
62 #endif // SOFTBOOKLZSSSTREAM_H_INCLUDED
63 
64 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition: SoftBookLZSSStream.cpp:228
const char * subStreamName(unsigned id) override
Definition: SoftBookLZSSStream.cpp:208
unsigned offsetBits
Definition: SoftBookLZSSStream.h:29
Configuration()
Definition: SoftBookLZSSStream.cpp:169
unsigned offset
Definition: SoftBookParser.cpp:74
long tell() override
Definition: SoftBookLZSSStream.cpp:238
RVNGInputStreamPtr_t stream
Definition: HTMLHelpStream.cpp:79
char fillChar
Definition: SoftBookLZSSStream.h:33
unsigned uncompressedLength
Definition: SoftBookLZSSStream.h:31
bool isStructured() override
Definition: SoftBookLZSSStream.cpp:198
SoftBookLZSSStream(const SoftBookLZSSStream &other)
bool existsSubStream(const char *name) override
Definition: SoftBookLZSSStream.cpp:213
Definition: SoftBookLZSSStream.h:20
const char * name
Definition: EBOOKHTMLToken.cpp:44
~SoftBookLZSSStream() override
Definition: SoftBookLZSSStream.cpp:194
unsigned lengthBits
Definition: SoftBookLZSSStream.h:30
unsigned subStreamCount() override
Definition: SoftBookLZSSStream.cpp:203
RVNGInputStream * getSubStreamById(unsigned id) override
Definition: SoftBookLZSSStream.cpp:223
bool bigEndian
Definition: SoftBookLZSSStream.h:35
Definition: BBeBCollector.cpp:18
SoftBookLZSSStream & operator=(const SoftBookLZSSStream &other)
unsigned fillPos
Definition: SoftBookLZSSStream.h:32
bool allowOverflow
Definition: SoftBookLZSSStream.h:34
Definition: SoftBookLZSSStream.h:27
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition: SoftBookLZSSStream.cpp:233
librevenge::RVNGInputStream * getSubStreamByName(const char *name) override
Definition: SoftBookLZSSStream.cpp:218
bool isEnd() override
Definition: SoftBookLZSSStream.cpp:243
std::unique_ptr< librevenge::RVNGInputStream > m_stream
Definition: SoftBookLZSSStream.h:57

Generated for libe-book by doxygen 1.8.14