Debian Codegraph @

src/lib/RVNGMemoryStream.h

raw symbols SCIP
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 ([email protected])
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 nullptr;
44 }
45 bool existsSubStream(const char *)
46 {
47 return false;
48 }
49 RVNGInputStream *getSubStreamByName(const char *)
50 {
51 return nullptr;
52 }
53 RVNGInputStream *getSubStreamById(unsigned)
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
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: */