mirror of
https://github.com/autc04/Retro68.git
synced 2025-02-18 02:30:48 +00:00
ResourceFile: error handling...
This commit is contained in:
parent
687fd2a779
commit
9a50b29581
@ -217,10 +217,13 @@ bool ResourceFile::read()
|
||||
case Format::basilisk:
|
||||
{
|
||||
fs::ifstream dataIn(path);
|
||||
if(!dataIn)
|
||||
return false;
|
||||
data = std::string(std::istreambuf_iterator<char>(dataIn),
|
||||
std::istreambuf_iterator<char>());
|
||||
|
||||
fs::ifstream rsrcIn(path.parent_path() / ".rsrc" / path.filename());
|
||||
if(rsrcIn)
|
||||
resources = Resources(rsrcIn);
|
||||
fs::ifstream finfIn(path.parent_path() / ".finf" / path.filename());
|
||||
if(finfIn)
|
||||
@ -234,9 +237,12 @@ bool ResourceFile::read()
|
||||
case Format::real:
|
||||
{
|
||||
fs::ifstream dataIn(path);
|
||||
if(!dataIn)
|
||||
return false;
|
||||
data = std::string(std::istreambuf_iterator<char>(dataIn),
|
||||
std::istreambuf_iterator<char>());
|
||||
fs::ifstream rsrcIn(path / "..namedfork" / "rsrc");
|
||||
if(rsrcIn)
|
||||
resources = Resources(rsrcIn);
|
||||
|
||||
char finf[32];
|
||||
|
Loading…
x
Reference in New Issue
Block a user