Fix issues with empty json and unknown path
This commit is contained in:
parent
8131b94a5d
commit
c8e547343b
2 changed files with 22 additions and 6 deletions
|
|
@ -26,10 +26,22 @@ SettingsManager::~SettingsManager()
|
|||
|
||||
json SettingsManager::GetSettings(std::string settings_key)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Check to see if the key exists in the settings store and |
|
||||
| return the settings associated with the key if it exists |
|
||||
\*---------------------------------------------------------*/
|
||||
if(settings_data.contains(settings_key))
|
||||
{
|
||||
return(settings_data[settings_key]);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| If the settings store doesn't contain the key, create an |
|
||||
| empty json and return it |
|
||||
\*---------------------------------------------------------*/
|
||||
json empty;
|
||||
|
||||
return(empty);
|
||||
}
|
||||
|
||||
void SettingsManager::LoadSettings(std::string filename)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue