xoreos  0.0.5
rimfile.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_RIMFILE_H
26 #define AURORA_RIMFILE_H
27 
28 #include <vector>
29 
30 #include "src/common/types.h"
31 #include "src/common/scopedptr.h"
32 
33 #include "src/aurora/types.h"
34 #include "src/aurora/archive.h"
35 #include "src/aurora/aurorafile.h"
36 
37 namespace Common {
38  class SeekableReadStream;
39 }
40 
41 namespace Aurora {
42 
61 class RIMFile : public Archive, public AuroraFile {
62 public:
65  ~RIMFile();
66 
68  const ResourceList &getResources() const;
69 
71  uint32 getResourceSize(uint32 index) const;
72 
74  Common::SeekableReadStream *getResource(uint32 index, bool tryNoCopy = false) const;
75 
76 private:
78  struct IResource {
81  };
82 
83  typedef std::vector<IResource> IResourceList;
84 
86 
89 
92 
95 
96  const IResource &getIResource(uint32 index) const;
97 };
98 
99 } // End of namespace Aurora
100 
101 #endif // AURORA_RIMFILE_H
Common::SeekableReadStream * getResource(uint32 index, bool tryNoCopy=false) const
Return a stream of the resource&#39;s contents.
Definition: rimfile.cpp:108
Definition: 2dafile.h:39
ResourceList _resources
External list of resource names and types.
Definition: rimfile.h:88
void readResList(Common::SeekableReadStream &rim, uint32 offset)
Definition: rimfile.cpp:77
const IResource & getIResource(uint32 index) const
Definition: rimfile.cpp:97
uint32 getResourceSize(uint32 index) const
Return the size of a resource.
Definition: rimfile.cpp:104
Handling various archive files.
uint32 offset
The offset of the resource within the RIM.
Definition: rimfile.h:79
A simple scoped smart pointer template.
std::list< Resource > ResourceList
Definition: archive.h:57
Base for BioWare&#39;s Aurora engine files.
Internal resource information.
Definition: rimfile.h:78
Low-level type definitions to handle fixed width types portably.
const ResourceList & getResources() const
Return the list of resources.
Definition: rimfile.cpp:93
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
IResourceList _iResources
Internal list of resource offsets and sizes.
Definition: rimfile.h:91
uint32_t uint32
Definition: types.h:204
Common::ScopedPtr< Common::SeekableReadStream > _rim
Definition: rimfile.h:85
Base class for most files found in games using BioWare&#39;s Aurora engine.
Definition: aurorafile.h:52
std::vector< IResource > IResourceList
Definition: rimfile.h:83
Class to hold resource data of a RIM archive file.
Definition: rimfile.h:61
An abstract file archive.
Definition: archive.h:45
RIMFile(Common::SeekableReadStream *rim)
Take over this stream and read a RIM file out of it.
Definition: rimfile.cpp:40
Interface for a seekable & readable data stream.
Definition: readstream.h:265
uint32 size
The resource&#39;s size.
Definition: rimfile.h:80
void load(Common::SeekableReadStream &rim)
Definition: rimfile.cpp:49