Added error checking for config.json

This commit is contained in:
2021-03-08 20:51:58 -05:00
parent fe13bac080
commit de99b127b1
10 changed files with 161 additions and 52 deletions

View File

@ -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();