xoreos  0.0.5
obbfile.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_OBBFILE_H
26 #define AURORA_OBBFILE_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 
56 class OBBFile : public Archive {
57 public:
60  ~OBBFile();
61 
63  const ResourceList &getResources() const;
64 
66  uint32 getResourceSize(uint32 index) const;
67 
69  Common::SeekableReadStream *getResource(uint32 index, bool tryNoCopy = false) const;
70 
71 private:
73  struct IResource {
77  };
78 
79  typedef std::vector<IResource> IResourceList;
80 
82 
85 
88 
91 
93 
94  const IResource &getIResource(uint32 index) const;
95 };
96 
97 } // End of namespace Aurora
98 
99 #endif // AURORA_OBBFILE_H
OBBFile(Common::SeekableReadStream *obb)
Take over this stream and read an OBB file out of it.
Definition: obbfile.cpp:39
uint32 uncompressedSize
The resource&#39;s uncompressed size.
Definition: obbfile.h:75
Definition: 2dafile.h:39
const ResourceList & getResources() const
Return the list of resources.
Definition: obbfile.cpp:153
Common::ScopedPtr< Common::SeekableReadStream > _obb
Definition: obbfile.h:81
const IResource & getIResource(uint32 index) const
Definition: obbfile.cpp:157
Handling various archive files.
ResourceList _resources
External list of resource names and types.
Definition: obbfile.h:84
A simple scoped smart pointer template.
std::vector< IResource > IResourceList
Definition: obbfile.h:79
void load(Common::SeekableReadStream &obb)
Definition: obbfile.cpp:48
std::list< Resource > ResourceList
Definition: archive.h:57
uint32 getResourceSize(uint32 index) const
Return the size of a resource.
Definition: obbfile.cpp:164
Base for BioWare&#39;s Aurora engine files.
uint32 compressedSize
The resource&#39;s compressed size.
Definition: obbfile.h:76
Internal resource information.
Definition: obbfile.h:73
uint32 offset
The offset of the resource within the OBB.
Definition: obbfile.h:74
Low-level type definitions to handle fixed width types portably.
Common::SeekableReadStream * getResource(uint32 index, bool tryNoCopy=false) const
Return a stream of the resource&#39;s contents.
Definition: obbfile.cpp:168
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
void readResList(Common::SeekableReadStream &index)
Definition: obbfile.cpp:66
uint32_t uint32
Definition: types.h:204
Common::SeekableReadStream * getIndex(Common::SeekableReadStream &obb)
Definition: obbfile.cpp:106
IResourceList _iResources
Internal list of resource offsets and sizes.
Definition: obbfile.h:87
An abstract file archive.
Definition: archive.h:45
Class to hold resource data of an OBB virtual filesystem.
Definition: obbfile.h:56
Interface for a seekable & readable data stream.
Definition: readstream.h:265