IWASnappyStream.h Source File documentation

IWASnappyStream.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 libetonyek 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 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef IWASNAPPYSTREAM_H_INCLUDED
11 #define IWASNAPPYSTREAM_H_INCLUDED
12
13 #include <librevenge-stream/librevenge-stream.h>
14
15 #include "libetonyek_utils.h"
16
17 namespace libetonyek
18 {
19
20 class IWASnappyStream : public librevenge::RVNGInputStream
21 {
22 public:
23 explicit IWASnappyStream(const RVNGInputStreamPtr_t &stream);
24 ~IWASnappyStream() override;
25
26 // for unit tests
27 static RVNGInputStreamPtr_t uncompressBlock(const RVNGInputStreamPtr_t &block);
28
29 bool isStructured() override;
30 unsigned subStreamCount() override;
31 const char *subStreamName(unsigned id) override;
32 bool existsSubStream(const char *name) override;
33
34 librevenge::RVNGInputStream *getSubStreamByName(const char *name) override;
35 librevenge::RVNGInputStream *getSubStreamById(unsigned id) override;
36
37 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) override;
38 int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override;
39 long tell() override;
40 bool isEnd() override;
41
42 private:
43 RVNGInputStreamPtr_t m_stream;
44 };
45
46 }
47
48 #endif // IWASNAPPYSTREAM_H_INCLUDED
49
50 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWASnappyStream.h
libetonyek::IWASnappyStream::IWASnappyStream
IWASnappyStream(const RVNGInputStreamPtr_t &stream)
Definition: IWASnappyStream.cpp:164
m_data
vector< unsigned char > & m_data
Definition: IWASnappyStream.cpp:37
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::IWASnappyStream
Definition: IWASnappyStream.h:20
libetonyek::IWASnappyStream::~IWASnappyStream
~IWASnappyStream() override
Definition: IWASnappyStream.cpp:173
libetonyek::IWASnappyStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition: IWASnappyStream.cpp:219
libetonyek::IWASnappyStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name) override
Definition: IWASnappyStream.cpp:204
IWORKMemoryStream.h
ETONYEK_DEBUG_MSG
#define ETONYEK_DEBUG_MSG(M)
Definition: libetonyek_utils.h:54
libetonyek::IWASnappyStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition: IWASnappyStream.cpp:214
m_blockStart
size_t m_blockStart
Uncompressed data.
Definition: IWASnappyStream.cpp:38
libetonyek::readU8
uint8_t readU8(const RVNGInputStreamPtr_t &input, bool)
Definition: libetonyek_utils.cpp:48
libetonyek::EndOfStreamException
Definition: libetonyek_utils.h:147
libetonyek::IWASnappyStream::existsSubStream
bool existsSubStream(const char *name) override
Definition: IWASnappyStream.cpp:199
libetonyek::IWASnappyStream::isEnd
bool isEnd() override
Definition: IWASnappyStream.cpp:229
libetonyek::IWASnappyStream::tell
long tell() override
Definition: IWASnappyStream.cpp:224
libetonyek::IWASnappyStream::subStreamName
const char * subStreamName(unsigned id) override
Definition: IWASnappyStream.cpp:194
libetonyek::IWORKToken::count
@ count
Definition: IWORKToken.h:515
libetonyek::IWASnappyStream::uncompressBlock
static RVNGInputStreamPtr_t uncompressBlock(const RVNGInputStreamPtr_t &block)
Definition: IWASnappyStream.cpp:177
libetonyek::IWORKToken::size
@ size
Definition: IWORKToken.h:395
libetonyek::IWORKToken::c
@ c
Definition: IWORKToken.h:509
libetonyek::getLength
unsigned long getLength(const RVNGInputStreamPtr_t &input)
Definition: libetonyek_utils.cpp:184
libetonyek::IWASnappyStream::subStreamCount
unsigned subStreamCount() override
Definition: IWASnappyStream.cpp:189
libetonyek::getRemainingLength
unsigned long getRemainingLength(const RVNGInputStreamPtr_t &input)
Definition: libetonyek_utils.cpp:215
libetonyek::IWASnappyStream::isStructured
bool isStructured() override
Definition: IWASnappyStream.cpp:184
libetonyek_utils.h
libetonyek::IWASnappyStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned id) override
Definition: IWASnappyStream.cpp:209
libetonyek::IWORKToken::b
@ b
Definition: IWORKToken.h:507
libetonyek::IWORKToken::offset
@ offset
Definition: IWORKToken.h:587
libetonyek::IWORKToken::end
@ end
Definition: IWORKToken.h:189
libetonyek::RVNGInputStreamPtr_t
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libetonyek_utils.h:82
libetonyek::IWASnappyStream::m_stream
RVNGInputStreamPtr_t m_stream
Definition: IWASnappyStream.h:43
libetonyek::IWORKToken::name
@ name
Definition: IWORKToken.h:578
libetonyek::IWORKToken::data
@ data
Definition: IWORKToken.h:174
libetonyek::readUVar
uint64_t readUVar(const RVNGInputStreamPtr_t &input)
Definition: libetonyek_utils.cpp:108
libetonyek::readU16
uint16_t readU16(const RVNGInputStreamPtr_t &input, bool bigEndian)
Definition: libetonyek_utils.cpp:60