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