implement reading of macbinary files

This commit is contained in:
Wolfgang Thaller 2015-07-17 01:59:23 +02:00
parent d3dc7a1d25
commit b8a4af80ca
1 changed files with 23 additions and 0 deletions

View File

@ -239,7 +239,30 @@ bool ResourceFile::read()
}
}
break;
case Format::macbin:
{
fs::ifstream in(path);
if(byte(in) != 0)
return false;
if(byte(in) > 63)
return false;
in.seekg(65);
type = ostype(in);
creator = ostype(in);
in.seekg(83);
int datasize = longword(in);
//int rsrcsize = longword(in);
in.seekg(0);
char header[124];
in.read(header, 124);
unsigned short crc = CalculateCRC(0,header,124);
if(word(in) != crc)
return false;
in.seekg(128 + datasize);
resources = Resources(in);
}
break;
default:
return false;
}