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
23 SoftBookLZSSStream(const SoftBookLZSSStream &other);
24 SoftBookLZSSStream &operator=(const SoftBookLZSSStream &other);
25
26 public:
27 struct Configuration
28 {
29 unsigned offsetBits;
30 unsigned lengthBits;
31 unsigned uncompressedLength;
32 unsigned fillPos;
33 char fillChar;
34 bool allowOverflow;
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: */
stream
RVNGInputStreamPtr_t stream
Definition HTMLHelpStream.cpp:79
name
string name
Definition HTMLHelpStream.cpp:80
offset
unsigned offset
Definition SoftBookParser.cpp:74
libebook::SoftBookLZSSStream
Definition SoftBookLZSSStream.h:21
libebook::SoftBookLZSSStream::getSubStreamById
RVNGInputStream * getSubStreamById(unsigned id) override
Definition SoftBookLZSSStream.cpp:223
libebook::SoftBookLZSSStream::isEnd
bool isEnd() override
Definition SoftBookLZSSStream.cpp:243
libebook::SoftBookLZSSStream::isStructured
bool isStructured() override
Definition SoftBookLZSSStream.cpp:198
libebook::SoftBookLZSSStream::existsSubStream
bool existsSubStream(const char *name) override
Definition SoftBookLZSSStream.cpp:213
libebook::SoftBookLZSSStream::~SoftBookLZSSStream
~SoftBookLZSSStream() override
Definition SoftBookLZSSStream.cpp:194
libebook::SoftBookLZSSStream::subStreamCount
unsigned subStreamCount() override
Definition SoftBookLZSSStream.cpp:203
libebook::SoftBookLZSSStream::SoftBookLZSSStream
SoftBookLZSSStream(const SoftBookLZSSStream &other)
libebook::SoftBookLZSSStream::m_stream
std::unique_ptr< librevenge::RVNGInputStream > m_stream
Definition SoftBookLZSSStream.h:57
libebook::SoftBookLZSSStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition SoftBookLZSSStream.cpp:233
libebook::SoftBookLZSSStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name) override
Definition SoftBookLZSSStream.cpp:218
libebook::SoftBookLZSSStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition SoftBookLZSSStream.cpp:228
libebook::SoftBookLZSSStream::subStreamName
const char * subStreamName(unsigned id) override
Definition SoftBookLZSSStream.cpp:208
libebook::SoftBookLZSSStream::operator=
SoftBookLZSSStream & operator=(const SoftBookLZSSStream &other)
libebook::SoftBookLZSSStream::tell
long tell() override
Definition SoftBookLZSSStream.cpp:238
libebook
Definition BBeBCollector.cpp:19
libebook::SoftBookLZSSStream::Configuration
Definition SoftBookLZSSStream.h:28
libebook::SoftBookLZSSStream::Configuration::offsetBits
unsigned offsetBits
Definition SoftBookLZSSStream.h:29
libebook::SoftBookLZSSStream::Configuration::uncompressedLength
unsigned uncompressedLength
Definition SoftBookLZSSStream.h:31
libebook::SoftBookLZSSStream::Configuration::allowOverflow
bool allowOverflow
Definition SoftBookLZSSStream.h:34
libebook::SoftBookLZSSStream::Configuration::bigEndian
bool bigEndian
Definition SoftBookLZSSStream.h:35
libebook::SoftBookLZSSStream::Configuration::fillPos
unsigned fillPos
Definition SoftBookLZSSStream.h:32
libebook::SoftBookLZSSStream::Configuration::Configuration
Configuration()
Definition SoftBookLZSSStream.cpp:169
libebook::SoftBookLZSSStream::Configuration::lengthBits
unsigned lengthBits
Definition SoftBookLZSSStream.h:30
libebook::SoftBookLZSSStream::Configuration::fillChar
char fillChar
Definition SoftBookLZSSStream.h:33