2009-09-07 19:23:46 +00:00
|
|
|
#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")
|
2009-09-07 19:23:46 +00:00
|
|
|
|
2012-08-23 01:49:03 +00:00
|
|
|
CAppConfig::CAppConfig()
|
2018-04-30 21:01:23 +01:00
|
|
|
: CConfig(BuildConfigPath())
|
2009-09-07 19:23:46 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-23 01:49:03 +00:00
|
|
|
Framework::CConfig::PathType CAppConfig::GetBasePath()
|
2009-09-07 19:23:46 +00:00
|
|
|
{
|
2012-08-23 01:49:03 +00:00
|
|
|
auto result = Framework::PathUtils::GetPersonalDataPath() / BASE_DATA_PATH;
|
|
|
|
return result;
|
2009-09-07 19:23:46 +00:00
|
|
|
}
|
|
|
|
|
2012-08-23 01:49:03 +00:00
|
|
|
Framework::CConfig::PathType CAppConfig::BuildConfigPath()
|
2009-09-07 19:23:46 +00:00
|
|
|
{
|
2012-08-23 01:49:03 +00:00
|
|
|
auto userPath(GetBasePath());
|
|
|
|
Framework::PathUtils::EnsurePathExists(userPath);
|
|
|
|
return userPath / CONFIG_FILENAME;
|
2009-09-07 19:23:46 +00:00
|
|
|
}
|