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