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;
62 };
63 
64 #endif
65 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
const char * subStreamName(unsigned) override
Definition: VSDInternalStream.h:32
bool existsSubStream(const char *) override
Definition: VSDInternalStream.h:36
long tell() override
Definition: VSDInternalStream.cpp:126
std::vector< unsigned char > m_buffer
Definition: VSDInternalStream.h:59
unsigned subStreamCount() override
Definition: VSDInternalStream.h:28
librevenge::RVNGInputStream * getSubStreamById(unsigned) override
Definition: VSDInternalStream.h:44
bool isEnd() override
Definition: VSDInternalStream.cpp:131
VSDInternalStream & operator=(const VSDInternalStream &)
unsigned long getSize() const
Definition: VSDInternalStream.h:52
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition: VSDInternalStream.cpp:103
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition: VSDInternalStream.cpp:78
~VSDInternalStream() override
Definition: VSDInternalStream.h:22
bool isStructured() override
Definition: VSDInternalStream.h:24
volatile long m_offset
Definition: VSDInternalStream.h:55
librevenge::RVNGInputStream * getSubStreamByName(const char *) override
Definition: VSDInternalStream.h:40
Definition: VSDInternalStream.h:18
VSDInternalStream(librevenge::RVNGInputStream *input, unsigned long size, bool compressed=false)
Definition: VSDInternalStream.cpp:14

Generated for libvisio by doxygen 1.8.5