#include <macresman.h>
Classes | |
struct | MacVers |
Public Member Functions | |
bool | open (const Path &fileName) |
bool | open (const Path &fileName, Archive &archive) |
void | close () |
bool | hasResFork () const |
SeekableReadStream * | getResource (uint32 typeID, uint16 resID) |
SeekableReadStream * | getResource (const String &filename) |
SeekableReadStream * | getResource (uint32 typeID, const String &filename) |
String | getResName (uint32 typeID, uint16 resID) const |
uint32 | getResLength (uint32 typeID, uint16 resID) |
uint32 | getResForkDataSize () const |
String | computeResForkMD5AsString (uint32 length=0, bool tail=false) const |
Path | getBaseFileName () const |
void | setBaseFileName (Common::Path str) |
MacResIDArray | getResIDArray (uint32 typeID) |
MacResTagArray | getResTagArray () |
bool | loadFromMacBinary (SeekableReadStream *stream) |
void | dumpRaw () |
Static Public Member Functions | |
static SeekableReadStream * | openFileOrDataFork (const Path &fileName, Archive &archive) |
static SeekableReadStream * | openFileOrDataFork (const Path &fileName) |
static SeekableReadStream * | openDataForkFromMacBinary (SeekableReadStream *inStream, DisposeAfterUse::Flag disposeAfterUse=DisposeAfterUse::NO) |
static bool | exists (const Path &fileName) |
static bool | getFileFinderInfo (const Path &fileName, Archive &archive, MacFinderInfo &outFinderInfo) |
static bool | getFileFinderInfo (const Path &fileName, Archive &archive, MacFinderInfo &outFinderInfo, MacFinderExtendedInfo &outFinderExtendedInfo) |
static bool | getFileFinderInfo (const Path &fileName, MacFinderInfo &outFinderInfo) |
static bool | getFileFinderInfo (const Path &fileName, MacFinderInfo &outFinderInfo, MacFinderExtendedInfo &outFinderExtendedInfo) |
static void | listFiles (Array< Path > &files, const Path &pattern) |
static int | getDataForkOffset () |
static bool | isMacBinary (SeekableReadStream &stream) |
static MacVers * | parseVers (SeekableReadStream *vvers) |
Class for handling Mac data and resource forks. It can read from raw, MacBinary, and AppleDouble formats.
bool Common::MacResManager::open | ( | const Path & | fileName | ) |
Open a Mac data/resource fork pair.
This uses SearchMan to find the data/resource forks. This should only be used from inside an engine.
fileName | The base file name of the file |
Open a Mac data/resource fork pair from within the given archive.
path | The path that holds the forks |
fileName | The base file name of the file |
|
static |
Opens file named fileName or data fork extracted as macbin
|
static |
Open data fork of macbinary.
|
static |
See if a Mac data/resource fork pair exists.
fileName | The base file name of the file |
|
static |
Attempt to read the Mac Finder info metadata for a file path.
fileName | The base file name of the file |
archive | The archive to search in |
outFinderInfo | The loaded and parsed Finder info |
outFinderExtendedInfo | The loaded and parsed Finder extended info |
void Common::MacResManager::close | ( | ) |
Close the Mac data/resource fork pair.
bool Common::MacResManager::hasResFork | ( | ) | const |
Query whether or not we have a data fork present.
SeekableReadStream* Common::MacResManager::getResource | ( | uint32 | typeID, |
uint16 | resID | ||
) |
Read resource from the MacBinary file
typeID | FourCC of the type |
resID | Resource ID to fetch |
SeekableReadStream* Common::MacResManager::getResource | ( | const String & | filename | ) |
Read resource from the MacBinary file
filename | file name of the resource |
SeekableReadStream* Common::MacResManager::getResource | ( | uint32 | typeID, |
const String & | filename | ||
) |
Read resource from the MacBinary file
typeID | FourCC of the type |
filename | file name of the resource |
String Common::MacResManager::getResName | ( | uint32 | typeID, |
uint16 | resID | ||
) | const |
Get the name of a given resource
typeID | FourCC of the type |
resID | Resource ID to fetch |
uint32 Common::MacResManager::getResLength | ( | uint32 | typeID, |
uint16 | resID | ||
) |
Get the length in bytes of a given resource
typeID | FourCC of the type |
resID | Resource ID to fetch |
uint32 Common::MacResManager::getResForkDataSize | ( | ) | const |
Get the size of the data portion of the resource fork
String Common::MacResManager::computeResForkMD5AsString | ( | uint32 | length = 0 , |
bool | tail = false |
||
) | const |
Calculate the MD5 checksum of the resource fork
length | The maximum length to compute for |
tail | Calculate length from the tail |
|
inline |
Get the base file name of the data/resource fork pair
MacResIDArray Common::MacResManager::getResIDArray | ( | uint32 | typeID | ) |
Return list of resource IDs with specified type ID
MacResTagArray Common::MacResManager::getResTagArray | ( | ) |
Return list of resource tags
bool Common::MacResManager::loadFromMacBinary | ( | SeekableReadStream * | stream | ) |
Load from stream in MacBinary format
void Common::MacResManager::dumpRaw | ( | ) |
Dump contents of the archive to ./dumps directory
|
static |
Check if the given stream is in the MacBinary format.
stream | The stream we're checking |