RVNGMemoryStream.h Source File documentation

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
23 #include <librevenge-stream/librevenge-stream.h>
24
25 namespace librevenge
26 {
27
28 class RVNGMemoryInputStream : public RVNGInputStream
29 {
30 public:
31 RVNGMemoryInputStream(unsigned char *data, unsigned long size);
32 ~RVNGMemoryInputStream();
33 bool isStructured()
34 {
35 return false;
36 }
37 unsigned subStreamCount()
38 {
39 return 0;
40 }
41 const char *subStreamName(unsigned)
42 {
43 return 0;
44 }
45 bool existsSubStream(const char *)
46 {
47 return false;
48 }
49 RVNGInputStream *getSubStreamByName(const char *)
50 {
51 return 0;
52 }
53 RVNGInputStream *getSubStreamById(unsigned)
54 {
55 return 0;
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
66 private:
67 long m_offset;
68 unsigned long m_size;
69 unsigned char *m_data;
70 RVNGMemoryInputStream(const RVNGMemoryInputStream &);
71 RVNGMemoryInputStream &operator=(const RVNGMemoryInputStream &);
72 };
73
74 }
75
76 #endif
77 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
librevenge::RVNGMemoryInputStream::m_data
unsigned char * m_data
Definition: RVNGMemoryStream.h:69
librevenge::RVNGMemoryInputStream::getSubStreamById
RVNGInputStream * getSubStreamById(unsigned)
Definition: RVNGMemoryStream.h:53
librevenge::RVNG_SEEK_END
@ RVNG_SEEK_END
Definition: RVNGStream.h:30
librevenge-stream.h
librevenge::RVNGMemoryInputStream
Definition: RVNGMemoryStream.h:29
librevenge::RVNGMemoryInputStream::subStreamCount
unsigned subStreamCount()
Definition: RVNGMemoryStream.h:37
librevenge::RVNGMemoryInputStream::isStructured
bool isStructured()
Analyses the content of the input stream to see whether it is an OLE2 storage.
Definition: RVNGMemoryStream.h:33
librevenge::RVNGMemoryInputStream::existsSubStream
bool existsSubStream(const char *)
Definition: RVNGMemoryStream.h:45
librevenge::RVNGMemoryInputStream::~RVNGMemoryInputStream
~RVNGMemoryInputStream()
Definition: RVNGMemoryStream.cpp:34
librevenge::RVNGMemoryInputStream::isEnd
bool isEnd()
Determines whether the current position is at the end of the stream.
Definition: RVNGMemoryStream.cpp:91
librevenge::RVNGMemoryInputStream::seek
int seek(long offset, RVNG_SEEK_TYPE seekType)
Moves to the next location inside the input stream.
Definition: RVNGMemoryStream.cpp:63
librevenge::RVNGMemoryInputStream::getSubStreamByName
RVNGInputStream * getSubStreamByName(const char *)
Extracts a named stream from an OLE2 storage.
Definition: RVNGMemoryStream.h:49
librevenge::RVNGMemoryInputStream::operator=
RVNGMemoryInputStream & operator=(const RVNGMemoryInputStream &)
librevenge::RVNG_SEEK_CUR
@ RVNG_SEEK_CUR
Definition: RVNGStream.h:28
librevenge::RVNG_SEEK_SET
@ RVNG_SEEK_SET
Definition: RVNGStream.h:29
librevenge::RVNGMemoryInputStream::RVNGMemoryInputStream
RVNGMemoryInputStream(unsigned char *data, unsigned long size)
Definition: RVNGMemoryStream.cpp:26
RVNGMemoryStream.h
librevenge::RVNGMemoryInputStream::getSize
unsigned long getSize() const
Definition: RVNGMemoryStream.h:61
librevenge::RVNGMemoryInputStream::m_size
unsigned long m_size
Definition: RVNGMemoryStream.h:68
librevenge::RVNGMemoryInputStream::m_offset
long m_offset
Definition: RVNGMemoryStream.h:67
librevenge::RVNGMemoryInputStream::RVNGMemoryInputStream
RVNGMemoryInputStream(const RVNGMemoryInputStream &)
librevenge::RVNGInputStream
Definition: RVNGStream.h:34
offset
unsigned offset
Definition: RVNGZipStream.cpp:77
librevenge::RVNG_SEEK_TYPE
RVNG_SEEK_TYPE
Definition: RVNGStream.h:27
librevenge::RVNGMemoryInputStream::read
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
librevenge::RVNGMemoryInputStream::subStreamName
const char * subStreamName(unsigned)
Definition: RVNGMemoryStream.h:41
librevenge
Definition: RVNGBinaryData.cpp:39
librevenge::RVNGMemoryInputStream::tell
long tell()
Returns the actual position inside the input stream.
Definition: RVNGMemoryStream.cpp:86