IMPLZSSStream.h Source File documentation

IMPLZSSStream.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 IMPLZSSSTREAM_H_INCLUDED
11 #define IMPLZSSSTREAM_H_INCLUDED
12
13 #include <boost/scoped_ptr.hpp>
14
15 #include <librevenge-stream/librevenge-stream.h>
16
17 namespace libebook
18 {
19
20 class IMPLZSSStream : public librevenge::RVNGInputStream
21 {
22 // disable copying
23 IMPLZSSStream(const IMPLZSSStream &other);
24 IMPLZSSStream &operator=(const IMPLZSSStream &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 IMPLZSSStream(librevenge::RVNGInputStream *stream, const Configuration &configuration = Configuration());
42 virtual ~IMPLZSSStream();
43
44 virtual bool isStructured();
45 virtual unsigned subStreamCount();
46 virtual const char *subStreamName(unsigned id);
47 virtual bool existsSubStream(const char *name);
48 virtual librevenge::RVNGInputStream *getSubStreamByName(const char *name);
49 virtual RVNGInputStream *getSubStreamById(unsigned id);
50
51 virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
52 virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
53 virtual long tell();
54 virtual bool isEnd();
55
56 private:
57 boost::scoped_ptr<librevenge::RVNGInputStream> m_stream;
58 };
59
60 }
61
62 #endif // IMPLZSSSTREAM_H_INCLUDED
63
64 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::IMPLZSSStream::isEnd
virtual bool isEnd()
Definition: IMPLZSSStream.cpp:243
libebook::IMPLZSSStream::isStructured
virtual bool isStructured()
Definition: IMPLZSSStream.cpp:198
libebook::IMPLZSSStream::existsSubStream
virtual bool existsSubStream(const char *name)
Definition: IMPLZSSStream.cpp:213
libebook::IMPLZSSStream::Configuration::bigEndian
bool bigEndian
Definition: IMPLZSSStream.h:35
libebook::IMPLZSSStream::getSubStreamByName
virtual librevenge::RVNGInputStream * getSubStreamByName(const char *name)
Definition: IMPLZSSStream.cpp:218
libebook::IMPLZSSStream::Configuration::uncompressedLength
unsigned uncompressedLength
Definition: IMPLZSSStream.h:31
libebook::IMPLZSSStream::~IMPLZSSStream
virtual ~IMPLZSSStream()
Definition: IMPLZSSStream.cpp:194
libebook::IMPLZSSStream::read
virtual const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: IMPLZSSStream.cpp:228
libebook::IMPLZSSStream::subStreamCount
virtual unsigned subStreamCount()
Definition: IMPLZSSStream.cpp:203
libebook::IMPLZSSStream::tell
virtual long tell()
Definition: IMPLZSSStream.cpp:238
libebook::IMPLZSSStream::Configuration::offsetBits
unsigned offsetBits
Definition: IMPLZSSStream.h:29
libebook::IMPLZSSStream::m_stream
boost::scoped_ptr< librevenge::RVNGInputStream > m_stream
Definition: IMPLZSSStream.h:57
libebook::IMPLZSSStream::operator=
IMPLZSSStream & operator=(const IMPLZSSStream &other)
libebook::IMPLZSSStream::subStreamName
virtual const char * subStreamName(unsigned id)
Definition: IMPLZSSStream.cpp:208
libebook::IMPLZSSStream::Configuration::Configuration
Configuration()
Definition: IMPLZSSStream.cpp:169
offset
unsigned offset
Definition: IMPParser.cpp:73
name
string name
Definition: CHMStream.cpp:80
libebook::IMPLZSSStream::IMPLZSSStream
IMPLZSSStream(const IMPLZSSStream &other)
libebook::IMPLZSSStream::Configuration::fillChar
char fillChar
Definition: IMPLZSSStream.h:33
libebook::IMPLZSSStream::Configuration::fillPos
unsigned fillPos
Definition: IMPLZSSStream.h:32
libebook
Definition: CHMParser.cpp:20
libebook::IMPLZSSStream::getSubStreamById
virtual RVNGInputStream * getSubStreamById(unsigned id)
Definition: IMPLZSSStream.cpp:223
stream
RVNGInputStreamPtr_t stream
Definition: CHMStream.cpp:79
libebook::IMPLZSSStream::Configuration
Definition: IMPLZSSStream.h:27
libebook::IMPLZSSStream::Configuration::lengthBits
unsigned lengthBits
Definition: IMPLZSSStream.h:30
libebook::IMPLZSSStream::seek
virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
Definition: IMPLZSSStream.cpp:233
libebook::IMPLZSSStream
Definition: IMPLZSSStream.h:20
libebook::IMPLZSSStream::Configuration::allowOverflow
bool allowOverflow
Definition: IMPLZSSStream.h:34