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 <vector>
36 #include <list>
37 
38 class WPXInputStream;
39 
40 namespace libwpd
41 {
42 
43 class IStorage;
44 class Stream;
45 class IStream;
46 
47 class Storage
48 {
49  friend class Stream;
50 
51 public:
52 
53  // for Storage::result()
55 
59  Storage( WPXInputStream *is );
60 
64  ~Storage();
65 
69  bool isOLEStream();
70 
74  Result result();
75 
76 private:
78 
79  // no copy or assign
80  Storage( const Storage & );
81  Storage &operator=( const Storage & );
82 
83 };
84 
85 class Stream
86 {
87  friend class Storage;
88  friend class IStorage;
89 
90 public:
91 
95  Stream( Storage *storage, const std::string &name );
96 
100  ~Stream();
101 
105  unsigned long size();
106 
110  unsigned long read( unsigned char *data, unsigned long maxlen );
111 
112 private:
114 
115  // no copy or assign
116  Stream( const Stream & );
117  Stream &operator=( const Stream & );
118 };
119 
120 } // namespace libwpd
121 
122 #endif // WPXOLESTREAM_H
123 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.4