ZMFInternalStream.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 a part of the libzmf 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 ZMFINTERNALSTREAM_H_INCLUDED
11 #define ZMFINTERNALSTREAM_H_INCLUDED
12 
13 #include <vector>
14 
15 #include <librevenge-stream/librevenge-stream.h>
16 
17 #include "libzmf_utils.h"
18 
19 namespace libzmf
20 {
21 
22 class ZMFInternalStream : public librevenge::RVNGInputStream
23 {
24 public:
25  ZMFInternalStream(const unsigned char *data, unsigned long size);
26  ZMFInternalStream(const std::vector<unsigned char> &data);
27  ZMFInternalStream(const RVNGInputStreamPtr &input, unsigned long size);
28  virtual ~ZMFInternalStream();
29 
30  virtual bool isStructured();
31  virtual unsigned subStreamCount();
32  virtual const char *subStreamName(unsigned id);
33  virtual bool existsSubStream(const char *name);
34  virtual librevenge::RVNGInputStream *getSubStreamByName(const char *name);
35  virtual librevenge::RVNGInputStream *getSubStreamById(unsigned id);
36 
37  const virtual unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
38  virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
39  virtual long tell();
40  virtual bool isEnd();
41 
42 private:
43  long m_offset;
44  unsigned long m_size;
45  const unsigned char *m_data;
46  unsigned char *m_tmpBuf;
50 };
51 
52 }
53 
54 #endif // ZMFINTERNALSTREAM_H_INCLUDED
55 
56 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
virtual const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: ZMFInternalStream.cpp:91
unsigned char * m_tmpBuf
Definition: ZMFInternalStream.h:46
virtual bool existsSubStream(const char *name)
Definition: ZMFInternalStream.cpp:76
virtual unsigned subStreamCount()
Definition: ZMFInternalStream.cpp:66
virtual long tell()
Definition: ZMFInternalStream.cpp:147
const unsigned char * m_data
Definition: ZMFInternalStream.h:45
long m_offset
Definition: ZMFInternalStream.h:43
virtual librevenge::RVNGInputStream * getSubStreamById(unsigned id)
Definition: ZMFInternalStream.cpp:86
Definition: ZMFInternalStream.h:22
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
Definition: libzmf_utils.h:72
ZMFInternalStream & operator=(const ZMFInternalStream &)
virtual ~ZMFInternalStream()
Definition: ZMFInternalStream.cpp:53
virtual bool isEnd()
Definition: ZMFInternalStream.cpp:152
Definition: BMIHeader.cpp:13
ZMFInternalStream(const unsigned char *data, unsigned long size)
Definition: ZMFInternalStream.cpp:17
virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
Definition: ZMFInternalStream.cpp:124
bool m_dataOwner
Definition: ZMFInternalStream.h:47
virtual librevenge::RVNGInputStream * getSubStreamByName(const char *name)
Definition: ZMFInternalStream.cpp:81
virtual bool isStructured()
Definition: ZMFInternalStream.cpp:61
unsigned long m_size
Definition: ZMFInternalStream.h:44
virtual const char * subStreamName(unsigned id)
Definition: ZMFInternalStream.cpp:71

Generated for libzmf by doxygen 1.8.11