27#include "common/array.h"
29#include "common/rect.h"
30#include "common/str.h"
31#include "common/str-array.h"
33#ifndef COMMON_MACRESMAN_H
34#define COMMON_MACRESMAN_H
56typedef Array<uint16> MacResIDArray;
57typedef Array<uint32> MacResTagArray;
58typedef bool (* ProgressUpdateCallback)(
void *, int);
79 kFinderFlagAlias = (1 << 15),
80 kFinderFlagInvisible = (1 << 14),
81 kFinderFlagBundle = (1 << 13),
82 kFinderFlagNameLocked = (1 << 12),
83 kFinderFlagStationery = (1 << 11),
84 kFinderFlagCustomIcon = (1 << 10),
85 kFinderFlagInited = (1 << 8),
86 kFinderFlagNoInit = (1 << 7),
87 kFinderFlagShared = (1 << 6),
89 kFinderFlagColorBit2 = (1 << 3),
90 kFinderFlagColorBit1 = (1 << 2),
91 kFinderFlagColorBit0 = (1 << 1),
110 static const uint kDataSize = 16;
119 int32 homeDirectoryID;
128#define MBI_INFOHDR 128
225 bool isMacFile()
const {
return _mode != kResForkNone; }
227 int getMode()
const {
return _mode; }
253 static int getDataForkOffset() {
return MBI_INFOHDR; }
285 uint32 getResForkSize()
const {
291 uint32 getDataForkSize()
const {
303 String computeResForkMD5AsString(uint32 length = 0,
bool tail =
false, ProgressUpdateCallback progressUpdateCallback =
nullptr,
void *callbackParameter =
nullptr)
const;
311 void setBaseFileName(
Common::Path str) { _baseFileName = str; }
364 static Path constructAppleDoubleName(
const Path &name);
388 static bool readAndValidateMacBinaryHeader(
SeekableReadStream &stream,
byte (&outMacBinaryHeader)[MBI_INFOHDR]);
390 static Path disassembleAppleDoubleName(
const Path &name,
bool *isAppleDouble);
416 ResMap() { reset(); }
433 typedef Resource *ResPtr;
435 int32 _resForkOffset;
Definition: archive.h:141
Definition: macresman.h:126
uint32 getResLength(uint32 typeID, uint16 resID)
MacResTagArray getResTagArray()
SeekableReadStream * getResource(uint32 typeID, uint16 resID)
static bool getFinderInfoFromMacBinary(SeekableReadStream *stream, MacFinderInfo &outFinderInfo, MacFinderExtendedInfo &outFinderExtendedInfo)
SeekableReadStream * getResource(const String &filename)
static bool isMacBinary(SeekableReadStream &stream)
Path getBaseFileName() const
Definition: macresman.h:309
uint16 getResID(uint32 typeID, const Common::String &filename)
static void listFiles(Array< Path > &files, const Path &pattern)
MacResIDArray getResIDArray(uint32 typeID)
bool open(const Path &fileName, Archive &archive)
bool isMacFile() const
Definition: macresman.h:225
bool loadFromMacBinary(SeekableReadStream *stream)
String getOriginalFileName() const
Definition: macresman.h:317
String computeResForkMD5AsString(uint32 length=0, bool tail=false, ProgressUpdateCallback progressUpdateCallback=nullptr, void *callbackParameter=nullptr) const
uint32 getResForkDataSize() const
bool open(const Path &fileName)
SeekableReadStream * getResource(uint32 typeID, const String &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 SeekableReadStream * openFileOrDataFork(const Path &fileName, Archive &archive)
String getResName(uint32 typeID, uint16 resID) const
static void writeMacBinary(SeekableWriteStream *outStream, SeekableReadStream *dataFork, SeekableReadStream *resourceFork, const Common::String &name, const MacFinderInfo &info, TimeDate *created=nullptr, TimeDate *modified=nullptr)
Definition: algorithm.h:29
Definition: macresman.h:70
Definition: macresman.h:109
Definition: macresman.h:63
Definition: macresman.h:77
Definition: macresman.h:345