27 #include "common/array.h" 28 #include "common/fs.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 56 typedef Array<uint16> MacResIDArray;
57 typedef Array<uint32> MacResTagArray;
58 typedef 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 144 bool open(
const Path &fileName);
174 static bool exists(
const Path &fileName);
186 static bool getFileFinderInfo(
const Path &fileName,
MacFinderInfo &outFinderInfo);
208 bool hasResFork()
const;
214 bool hasDataFork()
const;
220 bool isMacFile()
const {
return _mode != kResForkNone; }
222 int getMode()
const {
return _mode; }
248 static int getDataForkOffset() {
return MBI_INFOHDR; }
256 String getResName(uint32 typeID, uint16 resID)
const;
264 uint32 getResLength(uint32 typeID, uint16 resID);
270 uint32 getResForkDataSize()
const;
272 uint32 getResForkSize()
const {
278 uint32 getDataForkSize()
const {
290 String computeResForkMD5AsString(uint32 length = 0,
bool tail =
false, ProgressUpdateCallback progressUpdateCallback =
nullptr,
void *callbackParameter =
nullptr)
const;
298 void setBaseFileName(
Common::Path str) { _baseFileName = str; }
303 MacResIDArray getResIDArray(uint32 typeID);
308 MacResTagArray getResTagArray();
345 static Path constructAppleDoubleName(
const Path &name);
366 static bool readAndValidateMacBinaryHeader(
SeekableReadStream &stream, byte (&outMacBinaryHeader)[MBI_INFOHDR]);
368 static Path disassembleAppleDoubleName(
const Path &name,
bool *isAppleDouble);
394 ResMap() { reset(); }
411 typedef Resource *ResPtr;
413 int32 _resForkOffset;
Definition: macresman.h:126
Path getBaseFileName() const
Definition: macresman.h:296
Definition: archive.h:141
Definition: macresman.h:77
bool isMacFile() const
Definition: macresman.h:220
Definition: macresman.h:326
Definition: macresman.h:109
Definition: algorithm.h:29
Definition: macresman.h:63
Definition: macresman.h:70