Play-/Source/AppConfig.cpp

24 lines
527 B
C++
Raw Permalink Normal View History

#include "AppConfig.h"
#include "PathUtils.h"
2019-10-17 12:04:25 -04:00
#define BASE_DATA_PATH ("Play Data Files")
#define CONFIG_FILENAME ("config.xml")
CAppConfig::CAppConfig()
2018-04-30 21:01:23 +01:00
: CConfig(BuildConfigPath())
{
}
Framework::CConfig::PathType CAppConfig::GetBasePath()
{
auto result = Framework::PathUtils::GetPersonalDataPath() / BASE_DATA_PATH;
return result;
}
Framework::CConfig::PathType CAppConfig::BuildConfigPath()
{
auto userPath(GetBasePath());
Framework::PathUtils::EnsurePathExists(userPath);
return userPath / CONFIG_FILENAME;
}