RVNGStreamImplementation.h Source File documentation

RVNGStreamImplementation.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) 2006 Ariya Hidayat (ariya@kde.org)
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 RVNGSTREAMIMPLEMENTATION_H
21#define RVNGSTREAMIMPLEMENTATION_H
22
23#include "librevenge-stream-api.h"
24
25#include "RVNGStream.h"
26
27namespace librevenge
28{
29
30class RVNGFileStreamPrivate;
31
32 class REVENGE_STREAM_API RVNGFileStream: public RVNGInputStream
33{
34public:
35 explicit RVNGFileStream(const char *filename);
36 ~RVNGFileStream();
37
38 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
39 long tell();
40 int seek(long offset, RVNG_SEEK_TYPE seekType);
41 bool isEnd();
42
43 bool isStructured();
44 unsigned subStreamCount();
45 const char *subStreamName(unsigned id);
46 bool existsSubStream(const char *name);
47 RVNGInputStream *getSubStreamById(unsigned id);
48 RVNGInputStream *getSubStreamByName(const char *name);
49
50private:
51 RVNGFileStreamPrivate *d;
52 RVNGFileStream(const RVNGFileStream &); // copy is not allowed
53 RVNGFileStream &operator=(const RVNGFileStream &); // assignment is not allowed
54};
55
56class RVNGStringStreamPrivate;
57
58 class REVENGE_STREAM_API RVNGStringStream: public RVNGInputStream
59{
60public:
61 RVNGStringStream(const unsigned char *data, const unsigned int dataSize);
62 ~RVNGStringStream();
63
64 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
65 long tell();
66 int seek(long offset, RVNG_SEEK_TYPE seekType);
67 bool isEnd();
68
69 bool isStructured();
70 unsigned subStreamCount();
71 const char *subStreamName(unsigned);
72 bool existsSubStream(const char *name);
73 RVNGInputStream *getSubStreamByName(const char *name);
74 RVNGInputStream *getSubStreamById(unsigned);
75
76private:
77 RVNGStringStreamPrivate *d;
78 RVNGStringStream(const RVNGStringStream &); // copy is not allowed
79 RVNGStringStream &operator=(const RVNGStringStream &); // assignment is not allowed
80};
81
82}
83
84#endif // RVNGSTREAMIMPLEMENTATION_H
85/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
RVNGStream.h
offset
unsigned offset
Definition: RVNGZipStream.cpp:77
filename
std::string filename
Definition: RVNGZipStream.cpp:51
librevenge::RVNGFileStreamPrivate
Definition: RVNGStreamImplementation.cpp:44
librevenge::RVNGFileStream
Definition: RVNGStreamImplementation.h:33
librevenge::RVNGFileStream::RVNGFileStream
RVNGFileStream(const RVNGFileStream &)
librevenge::RVNGFileStream::operator=
RVNGFileStream & operator=(const RVNGFileStream &)
librevenge::RVNGFileStream::d
RVNGFileStreamPrivate * d
Definition: RVNGStreamImplementation.h:51
librevenge::RVNGInputStream
Definition: RVNGStream.h:34
librevenge::RVNGStringStreamPrivate
Definition: RVNGStreamImplementation.cpp:61
librevenge::RVNGStringStream
Definition: RVNGStreamImplementation.h:59
librevenge::RVNGStringStream::d
RVNGStringStreamPrivate * d
Definition: RVNGStreamImplementation.h:77
librevenge::RVNGStringStream::operator=
RVNGStringStream & operator=(const RVNGStringStream &)
librevenge::RVNGStringStream::RVNGStringStream
RVNGStringStream(const RVNGStringStream &)
librevenge-stream-api.h
REVENGE_STREAM_API
#define REVENGE_STREAM_API
Definition: librevenge-stream-api.h:34
librevenge
Definition: RVNGBinaryData.cpp:39
librevenge::RVNG_SEEK_TYPE
RVNG_SEEK_TYPE
Definition: RVNGStream.h:27