- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 "RVNGStream.h"
24
25 namespace librevenge
26 {
27
28 class RVNGFileStreamPrivate;
29
30 class RVNGFileStream: public RVNGInputStream
31 {
32 public:
33 explicit RVNGFileStream(const char *filename);
34 ~RVNGFileStream();
35
36 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
37 long tell();
38 int seek(long offset, RVNG_SEEK_TYPE seekType);
39 bool isEnd();
40
41 bool isStructured();
42 unsigned subStreamCount();
43 const char *subStreamName(unsigned id);
44 bool existsSubStream(const char *name);
45 RVNGInputStream *getSubStreamById(unsigned id);
46 RVNGInputStream *getSubStreamByName(const char *name);
47
48 private:
49 RVNGFileStreamPrivate *d;
50 RVNGFileStream(const RVNGFileStream &); // copy is not allowed
51 RVNGFileStream &operator=(const RVNGFileStream &); // assignment is not allowed
52 };
53
54 class RVNGStringStreamPrivate;
55
56 class RVNGStringStream: public RVNGInputStream
57 {
58 public:
59 RVNGStringStream(const unsigned char *data, const unsigned int dataSize);
60 ~RVNGStringStream();
61
62 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
63 long tell();
64 int seek(long offset, RVNG_SEEK_TYPE seekType);
65 bool isEnd();
66
67 bool isStructured();
68 unsigned subStreamCount();
69 const char *subStreamName(unsigned);
70 bool existsSubStream(const char *name);
71 RVNGInputStream *getSubStreamByName(const char *name);
72 RVNGInputStream *getSubStreamById(unsigned);
73
74 private:
75 RVNGStringStreamPrivate *d;
76 RVNGStringStream(const RVNGStringStream &); // copy is not allowed
77 RVNGStringStream &operator=(const RVNGStringStream &); // assignment is not allowed
78 };
79
80 }
81
82 #endif // RVNGSTREAMIMPLEMENTATION_H
83 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
librevenge::RVNGStringStream::getSubStreamById
RVNGInputStream * getSubStreamById(unsigned)
Definition: RVNGStreamImplementation.cpp:514
librevenge::RVNGStringStream::isEnd
bool isEnd()
Determines whether the current position is at the end of the stream.
Definition: RVNGStreamImplementation.cpp:442
librevenge::RVNGStringStream::tell
long tell()
Returns the actual position inside the input stream.
Definition: RVNGStreamImplementation.cpp:414
librevenge::RVNGFileStreamPrivate
Definition: RVNGStreamImplementation.cpp:43
librevenge::RVNGFileStream::seek
int seek(long offset, RVNG_SEEK_TYPE seekType)
Moves to the next location inside the input stream.
Definition: RVNGStreamImplementation.cpp:223
librevenge::RVNGFileStream::subStreamName
const char * subStreamName(unsigned id)
Definition: RVNGStreamImplementation.cpp:311
librevenge::RVNGFileStream::isStructured
bool isStructured()
Analyses the content of the input stream to see whether it is an OLE2 storage.
Definition: RVNGStreamImplementation.cpp:269
librevenge::RVNGFileStream::subStreamCount
unsigned subStreamCount()
Definition: RVNGStreamImplementation.cpp:305
librevenge::RVNGStringStreamPrivate
Definition: RVNGStreamImplementation.cpp:60
librevenge::RVNGStringStream::getSubStreamByName
RVNGInputStream * getSubStreamByName(const char *name)
Extracts a named stream from an OLE2 storage.
Definition: RVNGStreamImplementation.cpp:519
librevenge::RVNGStringStream::d
RVNGStringStreamPrivate * d
Definition: RVNGStreamImplementation.h:75
librevenge::RVNGFileStream::~RVNGFileStream
~RVNGFileStream()
Definition: RVNGStreamImplementation.cpp:139
librevenge::RVNGStringStream::subStreamName
const char * subStreamName(unsigned)
Definition: RVNGStreamImplementation.cpp:489
offset
unsigned offset
Definition: RVNGZipStream.cpp:74
librevenge::RVNGFileStream::getSubStreamById
RVNGInputStream * getSubStreamById(unsigned id)
Definition: RVNGStreamImplementation.cpp:336
librevenge::RVNGStringStream::operator=
RVNGStringStream & operator=(const RVNGStringStream &)
librevenge::RVNGStringStream
Definition: RVNGStreamImplementation.h:56
librevenge::RVNGFileStream::tell
long tell()
Returns the actual position inside the input stream.
Definition: RVNGStreamImplementation.cpp:216
librevenge::RVNGStringStream::~RVNGStringStream
~RVNGStringStream()
Definition: RVNGStreamImplementation.cpp:383
filename
std::string filename
Definition: RVNGZipStream.cpp:48
librevenge::RVNGFileStream::existsSubStream
bool existsSubStream(const char *name)
Definition: RVNGStreamImplementation.cpp:318
librevenge::RVNGFileStream::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: RVNGStreamImplementation.cpp:147
librevenge::RVNG_SEEK_TYPE
RVNG_SEEK_TYPE
Definition: RVNGStream.h:26
librevenge::RVNGStringStream::subStreamCount
unsigned subStreamCount()
Definition: RVNGStreamImplementation.cpp:483
librevenge::RVNGStringStream::seek
int seek(long offset, RVNG_SEEK_TYPE seekType)
Moves to the next location inside the input stream.
Definition: RVNGStreamImplementation.cpp:419
librevenge::RVNGStringStream::existsSubStream
bool existsSubStream(const char *name)
Definition: RVNGStreamImplementation.cpp:496
librevenge::RVNGStringStream::isStructured
bool isStructured()
Analyses the content of the input stream to see whether it is an OLE2 storage.
Definition: RVNGStreamImplementation.cpp:450
librevenge::RVNGFileStream::getSubStreamByName
RVNGInputStream * getSubStreamByName(const char *name)
Extracts a named stream from an OLE2 storage.
Definition: RVNGStreamImplementation.cpp:341
librevenge::RVNGFileStream::RVNGFileStream
RVNGFileStream(const char *filename)
Definition: RVNGStreamImplementation.cpp:107
librevenge::RVNGStringStream::RVNGStringStream
RVNGStringStream(const unsigned char *data, const unsigned int dataSize)
Definition: RVNGStreamImplementation.cpp:377
librevenge::RVNGInputStream
Definition: RVNGStream.h:33
librevenge::RVNGFileStream::isEnd
bool isEnd()
Determines whether the current position is at the end of the stream.
Definition: RVNGStreamImplementation.cpp:262
librevenge::RVNGFileStream::operator=
RVNGFileStream & operator=(const RVNGFileStream &)
RVNGStream.h
librevenge::RVNGFileStream
Definition: RVNGStreamImplementation.h:30
librevenge::RVNGFileStream::d
RVNGFileStreamPrivate * d
Definition: RVNGStreamImplementation.h:49
librevenge::RVNGStringStream::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: RVNGStreamImplementation.cpp:388