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
19namespace libzmf
20{
21
22class ZMFInternalStream : public librevenge::RVNGInputStream
23{
24public:
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
42private:
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: */
Definition ZMFInternalStream.h:23
virtual const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition ZMFInternalStream.cpp:91
ZMFInternalStream & operator=(const ZMFInternalStream &)
long m_offset
Definition ZMFInternalStream.h:43
virtual librevenge::RVNGInputStream * getSubStreamByName(const char *name)
Definition ZMFInternalStream.cpp:81
virtual ~ZMFInternalStream()
Definition ZMFInternalStream.cpp:53
virtual bool existsSubStream(const char *name)
Definition ZMFInternalStream.cpp:76
virtual long tell()
Definition ZMFInternalStream.cpp:147
unsigned char * m_tmpBuf
Definition ZMFInternalStream.h:46
virtual const char * subStreamName(unsigned id)
Definition ZMFInternalStream.cpp:71
virtual bool isEnd()
Definition ZMFInternalStream.cpp:152
const unsigned char * m_data
Definition ZMFInternalStream.h:45
virtual librevenge::RVNGInputStream * getSubStreamById(unsigned id)
Definition ZMFInternalStream.cpp:86
virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
Definition ZMFInternalStream.cpp:124
virtual unsigned subStreamCount()
Definition ZMFInternalStream.cpp:66
virtual bool isStructured()
Definition ZMFInternalStream.cpp:61
ZMFInternalStream(const ZMFInternalStream &)
unsigned long m_size
Definition ZMFInternalStream.h:44
bool m_dataOwner
Definition ZMFInternalStream.h:47
Definition BMIHeader.cpp:14
std::string prettyTypeName()
Definition libzmf_utils.h:60
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
Definition libzmf_utils.h:72

Generated for libzmf by doxygen 1.9.8