xoreos
0.0.5
|
Class to hold resource data of a RIM archive file. More...
#include <rimfile.h>
Classes | |
struct | IResource |
Internal resource information. More... | |
Public Member Functions | |
RIMFile (Common::SeekableReadStream *rim) | |
Take over this stream and read a RIM file out of it. More... | |
~RIMFile () | |
const ResourceList & | getResources () const |
Return the list of resources. More... | |
uint32 | getResourceSize (uint32 index) const |
Return the size of a resource. More... | |
Common::SeekableReadStream * | getResource (uint32 index, bool tryNoCopy=false) const |
Return a stream of the resource's contents. More... | |
Public Member Functions inherited from Aurora::Archive | |
Archive () | |
virtual | ~Archive () |
virtual Common::HashAlgo | getNameHashAlgo () const |
Return with which algorithm the name is hashed. More... | |
uint32 | findResource (uint64 hash) const |
Return the index of the resource matching the hash, or 0xFFFFFFFF if not found. More... | |
uint32 | findResource (const Common::UString &name, FileType type) const |
Return the index of the resource matching the name and type, or 0xFFFFFFFF if not found. More... | |
Public Member Functions inherited from Aurora::AuroraFile | |
AuroraFile () | |
void | clear () |
uint32 | getID () const |
Return the file's ID. More... | |
uint32 | getVersion () const |
Return the file's version. More... | |
bool | isUTF16LE () const |
Were the ID and version encoded in little-endian UTF-16 in the file? More... | |
Private Types | |
typedef std::vector< IResource > | IResourceList |
Private Member Functions | |
void | load (Common::SeekableReadStream &rim) |
void | readResList (Common::SeekableReadStream &rim, uint32 offset) |
const IResource & | getIResource (uint32 index) const |
Private Attributes | |
Common::ScopedPtr< Common::SeekableReadStream > | _rim |
ResourceList | _resources |
External list of resource names and types. More... | |
IResourceList | _iResources |
Internal list of resource offsets and sizes. More... | |
Additional Inherited Members | |
Public Types inherited from Aurora::Archive | |
typedef std::list< Resource > | ResourceList |
Static Public Member Functions inherited from Aurora::AuroraFile | |
static void | readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version, bool &utf16le) |
Read the header out of a stream. More... | |
static void | readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version) |
Read the ID and version out of a stream. More... | |
static uint32 | readHeaderID (Common::ReadStream &stream) |
Read the ID out of a stream. More... | |
Protected Member Functions inherited from Aurora::AuroraFile | |
void | readHeader (Common::ReadStream &stream) |
Static Protected Member Functions inherited from Aurora::AuroraFile | |
static uint32 | convertUTF16LE (uint32 x1, uint32 x2) |
Protected Attributes inherited from Aurora::AuroraFile | |
uint32 | _id |
The file's ID. More... | |
uint32 | _version |
The file's version. More... | |
bool | _utf16le |
The file's ID and version are in little-endian UTF-16. More... | |
Class to hold resource data of a RIM archive file.
A RIM file is a resource archive, used in several Aurora games. It is a simplified version of the more complex ERF format, lacking the support for a localized description text as found in early ERF formats, as well as compression and encryption as found in later ERF formats.
There is only one single version, V1.0, of the RIM format known and supported. For each resource file, it stores a path- and extension-less name (with a maximum of 16 ASCII characters) and a Type ID.
RIM files are found in Knights of the Old Republic, Knights of the Old Republic II and Jade Empire. They always have the .rim extension.
Note: .rim files in the Dragon Age games are not real RIM files. Instead, they are ERF files. See class ERFFile in erffile.h.
|
private |
Aurora::RIMFile::RIMFile | ( | Common::SeekableReadStream * | rim | ) |
Take over this stream and read a RIM file out of it.
Definition at line 40 of file rimfile.cpp.
Aurora::RIMFile::~RIMFile | ( | ) |
Definition at line 46 of file rimfile.cpp.
|
private |
Definition at line 97 of file rimfile.cpp.
References _iResources.
Referenced by getResource(), and getResourceSize().
|
virtual |
Return a stream of the resource's contents.
Implements Aurora::Archive.
Definition at line 108 of file rimfile.cpp.
References _rim, Common::ScopedPtrBase< T, Deallocator >::get(), getIResource(), Aurora::RIMFile::IResource::offset, and Aurora::RIMFile::IResource::size.
Referenced by Engines::DragonAge::Area::getName(), and Engines::DragonAge2::Area::getName().
|
virtual |
Return the list of resources.
Implements Aurora::Archive.
Definition at line 93 of file rimfile.cpp.
References _resources.
Return the size of a resource.
Reimplemented from Aurora::Archive.
Definition at line 104 of file rimfile.cpp.
References getIResource(), and Aurora::RIMFile::IResource::size.
|
private |
Definition at line 49 of file rimfile.cpp.
References Aurora::AuroraFile::_id, _iResources, _resources, Aurora::AuroraFile::_version, Common::StackException::add(), Common::debugTag(), kRIMID, kVersion1, Aurora::AuroraFile::readHeader(), readResList(), Common::ReadStream::readUint32LE(), and Common::SeekableReadStream::skip().
Referenced by RIMFile().
|
private |
Definition at line 77 of file rimfile.cpp.
References _iResources, _resources, Common::kEncodingASCII, Common::readStringFixed(), Common::ReadStream::readUint16LE(), Common::ReadStream::readUint32LE(), Common::SeekableReadStream::seek(), and Common::SeekableReadStream::skip().
Referenced by load().
|
private |
Internal list of resource offsets and sizes.
Definition at line 91 of file rimfile.h.
Referenced by getIResource(), load(), and readResList().
|
private |
External list of resource names and types.
Definition at line 88 of file rimfile.h.
Referenced by getResources(), load(), and readResList().
|
private |
Definition at line 85 of file rimfile.h.
Referenced by getResource(), and RIMFile().