Added error checking for config.json
This commit is contained in:
@ -70,6 +70,21 @@ public:
|
||||
spriteType = sType;
|
||||
if(sType == spriteAnimation)
|
||||
{
|
||||
std::string bogusPath = "src/config/credits.json";
|
||||
std::ifstream fin(bogusPath);
|
||||
|
||||
if(fin.is_open()){
|
||||
std::cout<<"file is open"<<std::endl;
|
||||
} else {
|
||||
std::cout<<"file is NOT open"<<std::endl;
|
||||
}
|
||||
|
||||
if(fin.fail()){
|
||||
std::cout<<"file open fail"<<std::endl;
|
||||
} else{
|
||||
std::cout<<"file open success"<<std::endl;
|
||||
}
|
||||
|
||||
std::ifstream jsonText(json);
|
||||
std::ostringstream tmp;
|
||||
tmp << jsonText.rdbuf();
|
||||
|
Reference in New Issue
Block a user