- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

WPXMemoryStream.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwpd
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 * For further information visit http://libwpd.sourceforge.net
20 */
21
22 /* "This product is not manufactured, approved, or supported by
23 * Corel Corporation or Corel Corporation Limited."
24 */
25
26 #ifndef MEMORYSTREAM_H
27 #define MEMORYSTREAM_H
28 #include <librevenge-stream/librevenge-stream.h>
29
30 class WPXMemoryInputStream : public librevenge::RVNGInputStream
31 {
32 public:
33 WPXMemoryInputStream(unsigned char *data, unsigned long size);
34 ~WPXMemoryInputStream();
35 bool isStructured()
36 {
37 return false;
38 }
39 unsigned subStreamCount()
40 {
41 return 0;
42 }
43 const char *subStreamName(unsigned)
44 {
45 return 0;
46 }
47 bool existsSubStream(const char *)
48 {
49 return false;
50 }
51 librevenge::RVNGInputStream *getSubStreamByName(const char *)
52 {
53 return 0;
54 }
55 librevenge::RVNGInputStream *getSubStreamById(unsigned)
56 {
57 return 0;
58 }
59 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
60 int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
61 long tell();
62 bool isEnd();
63 unsigned long getSize() const
64 {
65 return m_size;
66 }
67
68 private:
69 long m_offset;
70 unsigned long m_size;
71 unsigned char *m_data;
72 WPXMemoryInputStream(const WPXMemoryInputStream &);
73 WPXMemoryInputStream &operator=(const WPXMemoryInputStream &);
74 };
75
76 #endif
77 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPXMemoryInputStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned)
Definition: WPXMemoryStream.h:55
WPXMemoryInputStream
Definition: WPXMemoryStream.h:30
WPXMemoryInputStream::getSize
unsigned long getSize() const
Definition: WPXMemoryStream.h:63
WPXMemoryInputStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: WPXMemoryStream.cpp:43
WPXMemoryInputStream::m_size
unsigned long m_size
Definition: WPXMemoryStream.h:70
WPXMemoryInputStream::m_offset
long m_offset
Definition: WPXMemoryStream.h:69
WPXMemoryInputStream::tell
long tell()
Definition: WPXMemoryStream.cpp:91
WPXMemoryInputStream::operator=
WPXMemoryInputStream & operator=(const WPXMemoryInputStream &)
WPXMemoryInputStream::m_data
unsigned char * m_data
Definition: WPXMemoryStream.h:71
WPXMemoryInputStream::isStructured
bool isStructured()
Definition: WPXMemoryStream.h:35
WPXMemoryInputStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *)
Definition: WPXMemoryStream.h:51
WPXMemoryInputStream::~WPXMemoryInputStream
~WPXMemoryInputStream()
Definition: WPXMemoryStream.cpp:39
WPXMemoryInputStream::subStreamName
const char * subStreamName(unsigned)
Definition: WPXMemoryStream.h:43
WPXMemoryInputStream::existsSubStream
bool existsSubStream(const char *)
Definition: WPXMemoryStream.h:47
WPXMemoryInputStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
Definition: WPXMemoryStream.cpp:68
WPXMemoryInputStream::subStreamCount
unsigned subStreamCount()
Definition: WPXMemoryStream.h:39
WPXMemoryInputStream::WPXMemoryInputStream
WPXMemoryInputStream(unsigned char *data, unsigned long size)
Definition: WPXMemoryStream.cpp:31
WPXMemoryInputStream::isEnd
bool isEnd()
Definition: WPXMemoryStream.cpp:96