RVNGOLEStream.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* librevenge
3 
4  Original source: POLE - Portable C++ library to access OLE Storage
5  Copyright (C) 2002-2005 Ariya Hidayat <ariya@kde.org>
6 
7  Redistribution and use in source and binary forms, with or without
8  modification, are permitted provided that the following conditions
9  are met:
10  * Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12  * Redistributions in binary form must reproduce the above copyright notice,
13  this list of conditions and the following disclaimer in the documentation
14  and/or other materials provided with the distribution.
15  * Neither the name of the authors nor the names of its contributors may be
16  used to endorse or promote products derived from this software without
17  specific prior written permission.
18 
19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29  THE POSSIBILITY OF SUCH DAMAGE.
30 */
31 
32 #ifndef RVNGOLESTREAM_H
33 #define RVNGOLESTREAM_H
34 
35 #include <string>
36 #include <vector>
37 
38 namespace librevenge
39 {
40 
41 class RVNGInputStream;
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 
60 
64  ~Storage();
65 
69  bool isStructured();
70 
74  std::vector<std::string> getSubStreamNamesList();
75 
79  Result result();
80 
81 private:
83 
84  // no copy or assign
85  Storage(const Storage &);
86  Storage &operator=(const Storage &);
87 
88 };
89 
90 class Stream
91 {
92  friend class Storage;
93  friend class IStorage;
94 
95 public:
96 
100  Stream(Storage *storage, const std::string &name);
101 
105  ~Stream();
106 
110  unsigned long size();
111 
115  unsigned long read(unsigned char *data, unsigned long maxlen);
116 
117 private:
119 
120  // no copy or assign
121  Stream(const Stream &);
122  Stream &operator=(const Stream &);
123 };
124 
125 } // namespace librevenge
126 
127 #endif // RVNGOLESTREAM_H
128 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Result result()
Returns the error code of last operation.
Definition: RVNGOLEStream.cpp:1757
unsigned long read(unsigned char *data, unsigned long maxlen)
Reads a block of data.
Definition: RVNGOLEStream.cpp:1802
std::vector< std::string > getSubStreamNamesList()
Returns the list of substream name.
Definition: RVNGOLEStream.cpp:1767
Definition: RVNGOLEStream.cpp:684
unsigned long size()
Returns the stream size.
Definition: RVNGOLEStream.cpp:1797
Definition: RVNGOLEStream.cpp:467
Definition: RVNGOLEStream.h:47
IStream * m_io
Definition: RVNGOLEStream.h:118
Definition: RVNGOLEStream.h:54
Definition: RVNGOLEStream.h:90
Result
Definition: RVNGOLEStream.h:54
~Storage()
Destroys the storage.
Definition: RVNGOLEStream.cpp:1752
IStorage * m_io
Definition: RVNGOLEStream.h:82
Definition: RVNGOLEStream.h:54
Stream(Storage *storage, const std::string &name)
Creates a new stream.
Definition: RVNGOLEStream.cpp:1785
Definition: RVNGOLEStream.h:54
Definition: RVNGOLEStream.h:54
Storage & operator=(const Storage &)
Stream & operator=(const Stream &)
Definition: RVNGOLEStream.h:54
bool isStructured()
Checks whether the storage is OLE2 storage.
Definition: RVNGOLEStream.cpp:1762
~Stream()
Destroys the stream.
Definition: RVNGOLEStream.cpp:1792
Storage(RVNGInputStream *is)
Constructs a storage with data.
Definition: RVNGOLEStream.cpp:1746
Definition: RVNGStream.h:33

Generated for librevenge by doxygen 1.8.7