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);
179 static bool exists(
const Path &fileName);
191 static bool getFileFinderInfo(
const Path &fileName,
MacFinderInfo &outFinderInfo);
213 bool hasResFork()
const;
219 bool hasDataFork()
const;
225 bool isMacFile()
const {
return _mode != kResForkNone; }
227 int getMode()
const {
return _mode; }
253 static int getDataForkOffset() {
return MBI_INFOHDR; }
261 String getResName(uint32 typeID, uint16 resID)
const;
269 uint32 getResLength(uint32 typeID, uint16 resID);
283 uint32 getResForkDataSize()
const;
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; }
322 MacResIDArray getResIDArray(uint32 typeID);
327 MacResTagArray getResTagArray();
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: macresman.h:126
Path getBaseFileName() const
Definition: macresman.h:309
Definition: archive.h:141
Definition: macresman.h:77
bool isMacFile() const
Definition: macresman.h:225
Definition: macresman.h:345
Definition: macresman.h:109
Definition: algorithm.h:29
Definition: macresman.h:63
String getOriginalFileName() const
Definition: macresman.h:317
Definition: macresman.h:70