xoreos  0.0.5
keyfile.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_KEYFILE_H
26 #define AURORA_KEYFILE_H
27 
28 #include <vector>
29 
30 #include <boost/noncopyable.hpp>
31 
32 #include "src/common/types.h"
33 #include "src/common/ustring.h"
34 
35 #include "src/aurora/types.h"
36 #include "src/aurora/aurorafile.h"
37 
38 namespace Common {
39  class SeekableReadStream;
40 }
41 
42 namespace Aurora {
43 
70 class KEYFile : boost::noncopyable, public AuroraFile {
71 public:
73  struct Resource {
76 
79  };
80 
81  typedef std::vector<Resource> ResourceList;
82  typedef std::vector<Common::UString> BIFList;
83 
85  ~KEYFile();
86 
88  const BIFList &getBIFs() const;
89 
91  const ResourceList &getResources() const;
92 
93 private:
96 
98 
100  void readResList(Common::SeekableReadStream &key, uint32 offset);
101 };
102 
103 } // End of namespace Aurora
104 
105 #endif // AURORA_KEYFILE_H
Common::UString name
The resource&#39;s name.
Definition: keyfile.h:74
Definition: 2dafile.h:39
std::vector< Common::UString > BIFList
Definition: keyfile.h:82
A class holding an UTF-8 string.
Definition: ustring.h:48
A key resource index.
Definition: keyfile.h:73
KEYFile(Common::SeekableReadStream &key)
Definition: keyfile.cpp:43
void readResList(Common::SeekableReadStream &key, uint32 offset)
Definition: keyfile.cpp:119
const ResourceList & getResources() const
Return a list of all containing resources.
Definition: keyfile.cpp:145
ResourceList _resources
All containing resources.
Definition: keyfile.h:95
Class to hold resource index information of a KEY file.
Definition: keyfile.h:70
Base for BioWare&#39;s Aurora engine files.
Low-level type definitions to handle fixed width types portably.
Unicode string handling.
const BIFList & getBIFs() const
Return a list of all managed bifs.
Definition: keyfile.cpp:141
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
uint32_t uint32
Definition: types.h:204
BIFList _bifs
All managed bifs.
Definition: keyfile.h:94
Base class for most files found in games using BioWare&#39;s Aurora engine.
Definition: aurorafile.h:52
void load(Common::SeekableReadStream &key)
Definition: keyfile.cpp:50
FileType
Various file types used by the Aurora engine and found in archives.
Definition: types.h:56
FileType type
The resource&#39;s type.
Definition: keyfile.h:75
uint32 resIndex
Index into the bif&#39;s resource table.
Definition: keyfile.h:78
void readBIFList(Common::SeekableReadStream &key, uint32 offset)
Definition: keyfile.cpp:90
uint32 bifIndex
Index into the bif list.
Definition: keyfile.h:77
Interface for a seekable & readable data stream.
Definition: readstream.h:265
std::vector< Resource > ResourceList
Definition: keyfile.h:81