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

Generated for libcdr by doxygen 1.8.5