Main Page
Namespaces
Classes
Files
File List
File Members
WPXOLEStream.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/* POLE - Portable C++ library to access OLE Storage
3
Copyright (C) 2002-2005 Ariya Hidayat <ariya@kde.org>
4
5
Redistribution and use in source and binary forms, with or without
6
modification, are permitted provided that the following conditions
7
are met:
8
* Redistributions of source code must retain the above copyright notice,
9
this list of conditions and the following disclaimer.
10
* Redistributions in binary form must reproduce the above copyright notice,
11
this list of conditions and the following disclaimer in the documentation
12
and/or other materials provided with the distribution.
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
15
specific prior written permission.
16
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
27
THE POSSIBILITY OF SUCH DAMAGE.
28
*/
29
30
#ifndef WPXOLESTREAM_H
31
#define WPXOLESTREAM_H
32
33
#include <string>
34
#include <fstream>
35
#include <sstream>
36
#include <list>
37
38
namespace
libwpd
39
{
40
41
class
StorageIO;
42
class
Stream;
43
class
StreamIO;
44
45
class
Storage
46
{
47
friend
class
Stream
;
48
49
public
:
50
51
// for Storage::result()
52
enum
{
Ok
,
OpenFailed
,
NotOLE
,
BadOLE
,
UnknownError
};
53
57
Storage
(
const
std::stringstream &memorystream );
58
62
~Storage
();
63
67
bool
isOLEStream
();
68
72
int
result
();
73
74
private
:
75
StorageIO
*
io
;
76
77
// no copy or assign
78
Storage
(
const
Storage
& );
79
Storage
&
operator=
(
const
Storage
& );
80
81
};
82
83
class
Stream
84
{
85
friend
class
Storage
;
86
friend
class
StorageIO
;
87
88
public
:
89
93
// name must be absolute, e.g "/PerfectOffice_MAIN"
94
Stream
(
Storage
*storage,
const
std::string &name );
95
99
~Stream
();
100
104
unsigned
long
size
();
105
109
unsigned
long
read
(
unsigned
char
*data,
unsigned
long
maxlen );
110
111
private
:
112
StreamIO
*
io
;
113
114
// no copy or assign
115
Stream
(
const
Stream
& );
116
Stream
&
operator=
(
const
Stream
& );
117
};
118
119
}
// namespace libwpd
120
121
#endif // WPXOLESTREAM_H
122
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Generated for libwpd by
doxygen
1.8.1.2