Scribus
Open source desktop publishing at your fingertips
WPGStreamImplementation.h
1 /* libwpg
2  * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02111-1301 USA
18  *
19  * For further information visit http://libwpg.sourceforge.net
20  */
21 
22 #ifndef __WPGSTREAMIMPLEMENTATION_H__
23 #define __WPGSTREAMIMPLEMENTATION_H__
24 
25 #include "WPXStream.h"
26 
27 namespace libwpg
28 {
29 
30 class WPGFileStreamPrivate;
31 
33 {
34 public:
35  explicit WPGFileStream(const char* filename);
36  ~WPGFileStream();
37 
38  const uint8_t *read(size_t numBytes, size_t &numBytesRead);
39  long tell();
40  int seek(long offset, WPX_SEEK_TYPE seekType);
41  bool atEOS();
42 
43  bool isOLEStream();
44  WPXInputStream *getDocumentOLEStream(const char * name);
46 
47 private:
49  WPGFileStream(const WPGFileStream&); // copy is not allowed
50  WPGFileStream& operator=(const WPGFileStream&); // assignment is not allowed
51 };
52 
54 
56 {
57 public:
58  WPGMemoryStream(const char *data, const unsigned int dataSize);
59  ~WPGMemoryStream();
60 
61  const uint8_t *read(size_t numBytes, size_t &numBytesRead);
62  long tell();
63  int seek(long offset, WPX_SEEK_TYPE seekType);
64  bool atEOS();
65 
66  bool isOLEStream();
67  WPXInputStream *getDocumentOLEStream(const char * name);
69 
70 private:
72  WPGMemoryStream(const WPGMemoryStream&); // copy is not allowed
73  WPGMemoryStream& operator=(const WPGMemoryStream&); // assignment is not allowed
74 };
75 
76 } // namespace libwpg
77 
78 #endif // __WPGSTREAMIMPLEMENTATION_H__
bool atEOS()
Definition: WPGStreamImplementation.cpp:225
const uint8_t * read(size_t numBytes, size_t &numBytesRead)
Definition: WPGStreamImplementation.cpp:321
WPXInputStream * getDocumentOLEStream()
Definition: WPGStreamImplementation.cpp:297
int seek(long offset, WPX_SEEK_TYPE seekType)
Definition: WPGStreamImplementation.cpp:192
Definition: WPGStreamImplementation.cpp:34
Definition: WPXStream.h:36
Definition: WPGStreamImplementation.h:32
Definition: WPGStreamImplementation.cpp:51
long tell()
Definition: WPGStreamImplementation.cpp:187
const uint8_t * read(size_t numBytes, size_t &numBytesRead)
Definition: WPGStreamImplementation.cpp:122
WPXInputStream * getDocumentOLEStream()
Definition: WPGStreamImplementation.cpp:434
bool isOLEStream()
Definition: WPGStreamImplementation.cpp:230
Definition: WPGStreamImplementation.h:55
Definition: WPGBinaryData.h:34
int seek(long offset, WPX_SEEK_TYPE seekType)
Definition: WPGStreamImplementation.cpp:359
long tell()
Definition: WPGStreamImplementation.cpp:354
bool atEOS()
Definition: WPGStreamImplementation.cpp:386
bool isOLEStream()
Definition: WPGStreamImplementation.cpp:391