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

Generated for libfreehand by doxygen 1.9.7