ResourceFiles: read data forks from MacBinary and AppleSingle

This commit is contained in:
Wolfgang Thaller 2017-10-03 00:17:31 +02:00
parent eb9dd5aaff
commit 5f998b85be

View File

@ -265,13 +265,14 @@ bool ResourceFile::read()
in.seekg(26 + i * 12);
int what = longword(in);
int off = longword(in);
//int len = longword(in);
int len = longword(in);
in.seekg(off);
switch(what)
{
case 1:
// ###
// FIXME: read data fork
std::vector<char> buf(len);
in.read(buf, len);
data = std::string(buf.begin(), buf.end());
break;
case 2:
resources = Resources(in);
@ -342,7 +343,9 @@ bool ResourceFile::read()
unsigned short crc = CalculateCRC(0,header,124);
if(word(in) != crc)
return false;
// FIXME: read data fork
std::vector<char> buf(datasize);
in.read(buf, datasize);
data = std::string(buf.begin(), buf.end());
in.seekg(128 + datasize);
resources = Resources(in);
}