xoreos  0.0.5
zipfile.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef AURORA_ZIPFILE_H
26 #define AURORA_ZIPFILE_H
27 
28 #include "src/common/types.h"
29 #include "src/common/scopedptr.h"
30 
31 #include "src/aurora/types.h"
32 #include "src/aurora/archive.h"
33 
34 namespace Common {
35  class SeekableReadStream;
36  class ZipFile;
37 }
38 
39 namespace Aurora {
40 
42 class ZIPFile : public Archive {
43 public:
46  ~ZIPFile();
47 
49  const ResourceList &getResources() const;
50 
52  uint32 getResourceSize(uint32 index) const;
53 
55  Common::SeekableReadStream *getResource(uint32 index, bool tryNoCopy = false) const;
56 
57 private:
60 
63 
64  void load();
65 };
66 
67 } // End of namespace Aurora
68 
69 #endif // AURORA_ZIPFILE_H
const ResourceList & getResources() const
Return the list of resources.
Definition: zipfile.cpp:44
Definition: 2dafile.h:39
Common::SeekableReadStream * getResource(uint32 index, bool tryNoCopy=false) const
Return a stream of the resource&#39;s contents.
Definition: zipfile.cpp:52
uint32 getResourceSize(uint32 index) const
Return the size of a resource.
Definition: zipfile.cpp:48
Handling various archive files.
A simple scoped smart pointer template.
std::list< Resource > ResourceList
Definition: archive.h:57
Low-level type definitions to handle fixed width types portably.
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
ResourceList _resources
External list of resource names and types.
Definition: zipfile.h:62
uint32_t uint32
Definition: types.h:204
An abstract file archive.
Definition: archive.h:45
Interface for a seekable & readable data stream.
Definition: readstream.h:265
ZIPFile(Common::SeekableReadStream *zip)
Take over this stream and read a ZIP file out of it.
Definition: zipfile.cpp:33
A class encapsulating ZIP files for resource archive access.
Definition: zipfile.h:42
Common::ScopedPtr< Common::ZipFile > _zipFile
The actual zip file.
Definition: zipfile.h:59