RVNGMemoryStream.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2/* librevenge
3 * Version: MPL 2.0 / LGPLv2.1+
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 * Major Contributor(s):
10 * Copyright (C) 2004-2005 William Lachance (wrlach@gmail.com)
11 *
12 * For minor contributions see the git repository.
13 *
14 * Alternatively, the contents of this file may be used under the terms
15 * of the GNU Lesser General Public License Version 2.1 or later
16 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
17 * applicable instead of those above.
18 */
19
20#ifndef RVNGMEMORYSTREAM_H
21#define RVNGMEMORYSTREAM_H
22
24
25namespace librevenge
26{
27
29{
30public:
31 RVNGMemoryInputStream(unsigned char *data, unsigned long size);
34 {
35 return false;
36 }
37 unsigned subStreamCount()
38 {
39 return 0;
40 }
41 const char *subStreamName(unsigned)
42 {
43 return nullptr;
44 }
45 bool existsSubStream(const char *)
46 {
47 return false;
48 }
50 {
51 return nullptr;
52 }
54 {
55 return nullptr;
56 }
57 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
58 int seek(long offset, RVNG_SEEK_TYPE seekType);
59 long tell();
60 bool isEnd();
61 unsigned long getSize() const
62 {
63 return m_size;
64 }
65
66private:
68 unsigned long m_size;
69 unsigned char *m_data;
72};
73
74}
75
76#endif
77/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
RVNGInputStream()
Definition RVNGStream.h:36
unsigned char * m_data
Definition RVNGMemoryStream.h:69
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Tries to read a given number of bytes starting from the current position inside the input stream.
Definition RVNGMemoryStream.cpp:38
RVNGMemoryInputStream & operator=(const RVNGMemoryInputStream &)
bool existsSubStream(const char *)
Definition RVNGMemoryStream.h:45
bool isStructured()
Analyses the content of the input stream to see whether it is an OLE2 storage.
Definition RVNGMemoryStream.h:33
RVNGMemoryInputStream(const RVNGMemoryInputStream &)
long tell()
Returns the actual position inside the input stream.
Definition RVNGMemoryStream.cpp:86
RVNGInputStream * getSubStreamByName(const char *)
Extracts a named stream from an OLE2 storage.
Definition RVNGMemoryStream.h:49
bool isEnd()
Determines whether the current position is at the end of the stream.
Definition RVNGMemoryStream.cpp:91
RVNGInputStream * getSubStreamById(unsigned)
Definition RVNGMemoryStream.h:53
RVNGMemoryInputStream(unsigned char *data, unsigned long size)
Definition RVNGMemoryStream.cpp:26
unsigned long m_size
Definition RVNGMemoryStream.h:68
long m_offset
Definition RVNGMemoryStream.h:67
unsigned long getSize() const
Definition RVNGMemoryStream.h:61
const char * subStreamName(unsigned)
Definition RVNGMemoryStream.h:41
unsigned subStreamCount()
Definition RVNGMemoryStream.h:37
~RVNGMemoryInputStream()
Definition RVNGMemoryStream.cpp:34
int seek(long offset, RVNG_SEEK_TYPE seekType)
Moves to the next location inside the input stream.
Definition RVNGMemoryStream.cpp:63
Definition RVNGBinaryData.cpp:40
RVNG_SEEK_TYPE
Definition RVNGStream.h:27

Generated for librevenge by doxygen 1.14.0