62 _bifs.reserve(bifCount);
77 _bifs.resize(bifCount);
84 e.
add(
"Failed reading KEY file");
93 for (BIFList::iterator bif =
_bifs.begin(); bif !=
_bifs.end(); ++bif) {
107 const size_t curPos = key.
seek(nameOffset);
113 bif->replaceAll(
'\\',
'/');
114 if (bif->beginsWith(
"/"))
115 bif->erase(bif->begin());
132 res->bifIndex = (flags & 0xFFF00000) >> 20;
134 res->bifIndex =
id >> 20;
137 res->resIndex =
id & 0xFFFFF;
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
uint16 readUint16LE()
Read an unsigned 16-bit word stored in little endian (LSB first) order from the stream and return it...
void add(const char *s,...) GCC_PRINTF(2
uint32 readUint32LE()
Read an unsigned 32-bit word stored in little endian (LSB first) order from the stream and return it...
std::vector< Common::UString > BIFList
virtual size_t seek(ptrdiff_t offset, Origin whence=kOriginBegin)=0
Sets the stream position indicator for the stream.
KEYFile(Common::SeekableReadStream &key)
void readResList(Common::SeekableReadStream &key, uint32 offset)
const ResourceList & getResources() const
Return a list of all containing resources.
ResourceList _resources
All containing resources.
static const uint32 kVersion11
Utility templates and functions for working with strings and streams.
Exception that provides a stack of explanations.
static void readHeader(Common::ReadStream &stream, uint32 &id, uint32 &version, bool &utf16le)
Read the header out of a stream.
Handling BioWare's KEYs (resource index files).
Basic exceptions to throw.
Utility templates and functions.
virtual size_t skip(ptrdiff_t offset)
Skip the specified number of bytes, adding that offset to the current position in the stream...
Utility functions for working with differing string encodings.
uint32 _id
The file's ID.
uint32 _version
The file's version.
static const uint32 kKEYID
Basic reading stream interfaces.
const BIFList & getBIFs() const
Return a list of all managed bifs.
Plain, unextended ASCII (7bit clean).
UString debugTag(uint32 tag, bool trim)
Create an elaborate string from an integer tag, for debugging purposes.
BIFList _bifs
All managed bifs.
void load(Common::SeekableReadStream &key)
FileType
Various file types used by the Aurora engine and found in archives.
static const uint32 kVersion1
UString readStringFixed(SeekableReadStream &stream, Encoding encoding, size_t length)
Read length bytes as a string with the given encoding out of a stream.
void readBIFList(Common::SeekableReadStream &key, uint32 offset)
Interface for a seekable & readable data stream.
std::vector< Resource > ResourceList