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: */
libetonyek
Definition: IWORKBezierElement.cpp:20
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
libetonyek::IWASnappyStream::IWASnappyStream
IWASnappyStream(const RVNGInputStreamPtr_t &stream)
Definition: IWASnappyStream.cpp:164
libetonyek::IWASnappyStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition: IWASnappyStream.cpp:214
libetonyek::IWASnappyStream::isEnd
bool isEnd() override
Definition: IWASnappyStream.cpp:229
libetonyek::IWASnappyStream
Definition: IWASnappyStream.h:20
libetonyek::IWASnappyStream::subStreamName
const char * subStreamName(unsigned id) override
Definition: IWASnappyStream.cpp:194
libetonyek::IWASnappyStream::~IWASnappyStream
~IWASnappyStream() override
Definition: IWASnappyStream.cpp:173
libetonyek::IWASnappyStream::uncompressBlock
static RVNGInputStreamPtr_t uncompressBlock(const RVNGInputStreamPtr_t &block)
Definition: IWASnappyStream.cpp:177
libetonyek::IWASnappyStream::existsSubStream
bool existsSubStream(const char *name) override
Definition: IWASnappyStream.cpp:199
name
const char * name
Definition: IWORKToken.cpp:43
libetonyek::IWASnappyStream::tell
long tell() override
Definition: IWASnappyStream.cpp:224
libetonyek::IWASnappyStream::subStreamCount
unsigned subStreamCount() override
Definition: IWASnappyStream.cpp:189
libetonyek::IWASnappyStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned id) override
Definition: IWASnappyStream.cpp:209
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::IWASnappyStream::isStructured
bool isStructured() override
Definition: IWASnappyStream.cpp:184
libetonyek::IWORKToken::offset
Definition: IWORKToken.h:587
libetonyek_utils.h