MWAWOLEStream.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
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 MWAWOLESTREAM_HXX
31 #define MWAWOLESTREAM_HXX
32 
33 #include <string>
34 #include <fstream>
35 #include <vector>
36 
37 #include "libmwaw_internal.hxx"
38 
39 class WPXInputStream;
40 
42 namespace libmwawOLE
43 {
44 class IStorage;
45 class IStream;
46 
48 class Storage
49 {
50  friend class Stream;
51 
52 public:
53 
54  // for Storage::result()
56 
60  Storage( shared_ptr<WPXInputStream> is );
61 
65  ~Storage();
66 
70  bool isStructuredDocument();
71 
75  std::vector<std::string> getSubStreamList(std::string dir="/", bool onlyFiles=true);
76 
80  bool isSubStream(const std::string &name);
81 
85  bool isDirectory(const std::string &name);
86 
90  shared_ptr<WPXInputStream> getSubStream(const std::string &name);
91 
92 private:
96  shared_ptr<WPXInputStream> getSubStreamForDirectory(const std::string &name);
97 
100 
101  // no copy or assign
102  Storage( const Storage & );
103  Storage &operator=( const Storage & );
104 
105 };
106 
107 } // namespace libmwawOLE
108 
109 #endif // WPXOLESTREAM_H
110 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
libmwawOLE::IStorage * m_io
the main data storage
Definition: MWAWOLEStream.hxx:99
class used to read/parse an OLE file
Definition: MWAWOLEStream.hxx:48
Storage & operator=(const Storage &)
Internal and low level: class of libmwawOLE used to read an OLE with various functions to retrieve th...
Definition: MWAWOLEStream.cxx:917
Definition: MWAWOLEStream.hxx:55
~Storage()
Destroys the storage.
Definition: MWAWOLEStream.cxx:1693
Definition: MWAWOLEStream.hxx:55
Definition: MWAWOLEStream.hxx:55
friend class Stream
Definition: MWAWOLEStream.hxx:50
shared_ptr< WPXInputStream > getSubStreamForDirectory(const std::string &name)
Returns a WPXInputStream corresponding to a directory substream.
Definition: MWAWOLEStream.cxx:1780
bool isDirectory(const std::string &name)
Returns true if name corresponds to a directory.
Definition: MWAWOLEStream.cxx:1733
Storage(shared_ptr< WPXInputStream > is)
Constructs a storage with data.
Definition: MWAWOLEStream.cxx:1688
bool isSubStream(const std::string &name)
Returns true if name corresponds to a sub stream.
Definition: MWAWOLEStream.cxx:1723
bool isStructuredDocument()
Checks whether the storage is OLE2 storage.
Definition: MWAWOLEStream.cxx:1698
Definition: MWAWOLEStream.hxx:55
Result
Definition: MWAWOLEStream.hxx:55
std::vector< std::string > getSubStreamList(std::string dir="/", bool onlyFiles=true)
Returns the list of all ole leaves names.
Definition: MWAWOLEStream.cxx:1703
shared_ptr< WPXInputStream > getSubStream(const std::string &name)
Returns a WPXInputStream corresponding to a leaf/directory substream.
Definition: MWAWOLEStream.cxx:1743
Definition: MWAWOLEStream.hxx:55

Generated on Tue Mar 10 2015 17:32:09 for libmwaw by doxygen 1.8.5