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() override;
35  bool isStructured() override
36  {
37  return false;
38  }
39  unsigned subStreamCount() override
40  {
41  return 0;
42  }
43  const char *subStreamName(unsigned) override
44  {
45  return nullptr;
46  }
47  bool existsSubStream(const char *) override
48  {
49  return false;
50  }
51  librevenge::RVNGInputStream *getSubStreamByName(const char *) override
52  {
53  return nullptr;
54  }
55  librevenge::RVNGInputStream *getSubStreamById(unsigned) override
56  {
57  return nullptr;
58  }
59  const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) override;
60  int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override;
61  long tell() override;
62  bool isEnd() override;
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;
74 };
75 
76 #endif
77 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPXMemoryInputStream::isEnd
bool isEnd() override
Definition: WPXMemoryStream.cpp:96
WPXMemoryInputStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned) override
Definition: WPXMemoryStream.h:55
WPXMemoryInputStream::~WPXMemoryInputStream
~WPXMemoryInputStream() override
Definition: WPXMemoryStream.cpp:39
WPXMemoryInputStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition: WPXMemoryStream.cpp:68
WPXMemoryInputStream::m_offset
long m_offset
Definition: WPXMemoryStream.h:69
WPXMemoryInputStream::subStreamCount
unsigned subStreamCount() override
Definition: WPXMemoryStream.h:39
WPXMemoryInputStream::m_data
unsigned char * m_data
Definition: WPXMemoryStream.h:71
WPXMemoryInputStream::getSize
unsigned long getSize() const
Definition: WPXMemoryStream.h:63
WPXMemoryInputStream::tell
long tell() override
Definition: WPXMemoryStream.cpp:91
WPXMemoryInputStream::subStreamName
const char * subStreamName(unsigned) override
Definition: WPXMemoryStream.h:43
libwpd_internal.h
WPXMemoryInputStream::existsSubStream
bool existsSubStream(const char *) override
Definition: WPXMemoryStream.h:47
WPXMemoryInputStream::WPXMemoryInputStream
WPXMemoryInputStream(unsigned char *data, unsigned long size)
Definition: WPXMemoryStream.cpp:31
WPXMemoryInputStream::isStructured
bool isStructured() override
Definition: WPXMemoryStream.h:35
WPXMemoryInputStream
Definition: WPXMemoryStream.h:31
WPXMemoryInputStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition: WPXMemoryStream.cpp:43
WPXMemoryInputStream::operator=
WPXMemoryInputStream & operator=(const WPXMemoryInputStream &)
WPXMemoryInputStream::WPXMemoryInputStream
WPXMemoryInputStream(const WPXMemoryInputStream &)
WPXMemoryStream.h
WPXMemoryInputStream::m_size
unsigned long m_size
Definition: WPXMemoryStream.h:70
WPXMemoryInputStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *) override
Definition: WPXMemoryStream.h:51

Generated for libwpd by doxygen 1.8.20