1
/* POLE - Portable C++ library to access OLE Storage
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/* POLE - Portable C++ library to access OLE Storage
2
3
Copyright (C) 2002-2005 Ariya Hidayat <ariya@kde.org>
4
Redistribution and use in source and binary forms, with or without
5
modification, are permitted provided that the following conditions
5
Redistribution and use in source and binary forms, with or without
6
modification, are permitted provided that the following conditions
7
* Redistributions of source code must retain the above copyright notice,
8
* Redistributions of source code must retain the above copyright notice,
8
9
this list of conditions and the following disclaimer.
9
* Redistributions in binary form must reproduce the above copyright notice,
10
this list of conditions and the following disclaimer in the documentation
10
* Redistributions in binary form must reproduce the above copyright notice,
11
this list of conditions and the following disclaimer in the documentation
11
12
and/or other materials provided with the distribution.
12
* Neither the name of the authors nor the names of its contributors may be
13
used to endorse or promote products derived from this software without
13
* Neither the name of the authors nor the names of its contributors may be
14
used to endorse or promote products derived from this software without
14
15
specific prior written permission.
16
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26
27
THE POSSIBILITY OF SUCH DAMAGE.
50
// for Storage::result()
51
enum { Ok, OpenFailed, NotOLE, BadOLE, UnknownError };
54
* Constructs a storage with data.
56
Storage( const std::stringstream &memorystream );
59
* Destroys the storage.
64
* Checks whether the storage is OLE2 storage.
69
* Returns the error code of last operation.
51
// for Storage::result()
52
enum { Ok, OpenFailed, NotOLE, BadOLE, UnknownError };
55
* Constructs a storage with data.
57
Storage( const std::stringstream &memorystream );
60
* Destroys the storage.
65
* Checks whether the storage is OLE2 storage.
70
* Returns the error code of last operation.
77
Storage( const Storage& );
78
Storage& operator=( const Storage& );
78
Storage( const Storage & );
79
Storage &operator=( const Storage & );
85
friend class StorageIO;
86
friend class StorageIO;
90
* Creates a new stream.
92
// name must be absolute, e.g "/PerfectOffice_MAIN"
93
Stream( Storage* storage, const std::string& name );
96
* Destroys the stream.
101
* Returns the stream size.
103
unsigned long size();
106
* Reads a block of data.
108
unsigned long read( unsigned char* data, unsigned long maxlen );
91
* Creates a new stream.
93
// name must be absolute, e.g "/PerfectOffice_MAIN"
94
Stream( Storage *storage, const std::string &name );
97
* Destroys the stream.
102
* Returns the stream size.
104
unsigned long size();
107
* Reads a block of data.
109
unsigned long read( unsigned char *data, unsigned long maxlen );
114
Stream( const Stream& );
115
Stream& operator=( const Stream& );
115
Stream( const Stream & );
116
Stream &operator=( const Stream & );
118
119
} // namespace libwpd
120
121
#endif // WPXOLESTREAM_H
122
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */