WPXStreamImplementation.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) 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  * For further information visit http://libwpd.sourceforge.net
20  */
21 
22 #ifndef __WPXSTREAMIMPLEMENTATION_H__
23 #define __WPXSTREAMIMPLEMENTATION_H__
24 
25 #include "WPXStream.h"
26 
28 
30 {
31 public:
32  explicit WPXFileStream(const char *filename);
34 
35  const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
36  long tell();
37  int seek(long offset, WPX_SEEK_TYPE seekType);
38  bool atEOS();
39 
40  bool isOLEStream();
41  WPXInputStream *getDocumentOLEStream(const char *name);
42 
43 private:
45  WPXFileStream(const WPXFileStream &); // copy is not allowed
46  WPXFileStream &operator=(const WPXFileStream &); // assignment is not allowed
47 };
48 
50 
52 {
53 public:
54  WPXStringStream(const unsigned char *data, const unsigned int dataSize);
56 
57  const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
58  long tell();
59  int seek(long offset, WPX_SEEK_TYPE seekType);
60  bool atEOS();
61 
62  bool isOLEStream();
63  WPXInputStream *getDocumentOLEStream(const char *name);
64 
65 private:
67  WPXStringStream(const WPXStringStream &); // copy is not allowed
68  WPXStringStream &operator=(const WPXStringStream &); // assignment is not allowed
69 };
70 
71 #endif // __WPXSTREAMIMPLEMENTATION_H__
72 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Definition: WPXStreamImplementation.cpp:46
WPXFileStreamPrivate * d
Definition: WPXStreamImplementation.h:44
WPXStringStream(const unsigned char *data, const unsigned int dataSize)
Definition: WPXStreamImplementation.cpp:337
int seek(long offset, WPX_SEEK_TYPE seekType)
Moves to the next location inside the input stream.
Definition: WPXStreamImplementation.cpp:222
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: WPXStreamImplementation.cpp:348
Definition: WPXStreamImplementation.cpp:62
long tell()
Returns the actual position inside the input stream.
Definition: WPXStreamImplementation.cpp:215
WPXStringStream & operator=(const WPXStringStream &)
Definition: WPXStreamImplementation.h:29
WPXStringStreamPrivate * d
Definition: WPXStreamImplementation.h:66
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: WPXStreamImplementation.cpp:146
bool isOLEStream()
Analyses the content of the input stream to see whether it is an OLE2 storage.
Definition: WPXStreamImplementation.cpp:268
bool isOLEStream()
Analyses the content of the input stream to see whether it is an OLE2 storage.
Definition: WPXStreamImplementation.cpp:410
WPXFileStream(const char *filename)
Definition: WPXStreamImplementation.cpp:106
WPXFileStream & operator=(const WPXFileStream &)
long tell()
Returns the actual position inside the input stream.
Definition: WPXStreamImplementation.cpp:374
~WPXStringStream()
Definition: WPXStreamImplementation.cpp:343
int seek(long offset, WPX_SEEK_TYPE seekType)
Moves to the next location inside the input stream.
Definition: WPXStreamImplementation.cpp:379
bool atEOS()
Determines whether the current position is at the end of the stream.
Definition: WPXStreamImplementation.cpp:261
~WPXFileStream()
Definition: WPXStreamImplementation.cpp:138
WPXInputStream * getDocumentOLEStream(const char *name)
Extracts a PerfectOffice_MAIN stream from an OLE2 storage.
Definition: WPXStreamImplementation.cpp:443
Definition: WPXStream.h:36
bool atEOS()
Determines whether the current position is at the end of the stream.
Definition: WPXStreamImplementation.cpp:402
WPXInputStream * getDocumentOLEStream(const char *name)
Extracts a PerfectOffice_MAIN stream from an OLE2 storage.
Definition: WPXStreamImplementation.cpp:302
Definition: WPXStreamImplementation.h:51
WPX_SEEK_TYPE
Definition: WPXStream.h:29

Generated for libwpd by doxygen 1.8.5