ABWZlibStream.h Source File documentation

ABWZlibStream.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 libabw 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 __ABWZLIBSTREAM_H__
11#define __ABWZLIBSTREAM_H__
12
13#include <vector>
14#include <librevenge-stream/librevenge-stream.h>
15
16namespace libabw
17{
18
19 class ABWZlibStream : public librevenge::RVNGInputStream
20{
21public:
22 ABWZlibStream(librevenge::RVNGInputStream *input);
23 ~ABWZlibStream() override {}
24
25 bool isStructured() override
26 {
27 return false;
28 }
29 unsigned subStreamCount() override
30 {
31 return 0;
32 }
33 const char *subStreamName(unsigned) override
34 {
35 return nullptr;
36 }
37 bool existsSubStream(const char *) override
38 {
39 return false;
40 }
41 librevenge::RVNGInputStream *getSubStreamByName(const char *) override
42 {
43 return nullptr;
44 }
45 librevenge::RVNGInputStream *getSubStreamById(unsigned) override
46 {
47 return nullptr;
48 }
49 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) override;
50 int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override;
51 long tell() override;
52 bool isEnd() override;
53 unsigned long getSize() const
54 {
55 return m_buffer.size();
56 }
57private:
58 librevenge::RVNGInputStream *m_input;
59 volatile long m_offset;
60 std::vector<unsigned char> m_buffer;
61 ABWZlibStream(const ABWZlibStream &);
62 ABWZlibStream &operator=(const ABWZlibStream &);
63};
64
65} // namespace libabw
66
67#endif // __ABWZLIBSTREAM_H__
68/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libabw::ABWZlibStream::ABWZlibStream
ABWZlibStream(const ABWZlibStream &)
libabw::ABWZlibStream::isStructured
bool isStructured() override
Definition ABWZlibStream.h:25
libabw::ABWZlibStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *) override
Definition ABWZlibStream.h:41
libabw::ABWZlibStream::m_buffer
std::vector< unsigned char > m_buffer
Definition ABWZlibStream.h:60
libabw::ABWZlibStream::subStreamCount
unsigned subStreamCount() override
Definition ABWZlibStream.h:29
libabw::ABWZlibStream::operator=
ABWZlibStream & operator=(const ABWZlibStream &)
libabw::ABWZlibStream::ABWZlibStream
ABWZlibStream(librevenge::RVNGInputStream *input)
Definition ABWZlibStream.cpp:81
libabw::ABWZlibStream::m_input
librevenge::RVNGInputStream * m_input
Definition ABWZlibStream.h:58
libabw::ABWZlibStream::~ABWZlibStream
~ABWZlibStream() override
Definition ABWZlibStream.h:23
libabw::ABWZlibStream::isEnd
bool isEnd() override
Definition ABWZlibStream.cpp:159
libabw::ABWZlibStream::existsSubStream
bool existsSubStream(const char *) override
Definition ABWZlibStream.h:37
libabw::ABWZlibStream::subStreamName
const char * subStreamName(unsigned) override
Definition ABWZlibStream.h:33
libabw::ABWZlibStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition ABWZlibStream.cpp:127
libabw::ABWZlibStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned) override
Definition ABWZlibStream.h:45
libabw::ABWZlibStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition ABWZlibStream.cpp:99
libabw::ABWZlibStream::getSize
unsigned long getSize() const
Definition ABWZlibStream.h:53
libabw::ABWZlibStream::tell
long tell() override
Definition ABWZlibStream.cpp:151
libabw::ABWZlibStream::m_offset
volatile long m_offset
Definition ABWZlibStream.h:59
libabw
Definition AbiDocument.cpp:17