2010-05-10 03:12:24 +00:00
|
|
|
#include "AppConfig.h"
|
|
|
|
#include "PathUtils.h"
|
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
#define BASE_DATA_PATH (L"PsfPlayer Data Files")
|
|
|
|
#define CONFIG_FILENAME (L"config.xml")
|
2010-05-10 03:12:24 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
CAppConfig::CAppConfig()
|
|
|
|
: CConfig(BuildConfigPath())
|
2010-05-10 03:12:24 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
CAppConfig::~CAppConfig()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Framework::CConfig::PathType CAppConfig::GetBasePath()
|
|
|
|
{
|
2012-11-14 05:14:08 +00:00
|
|
|
auto result = Framework::PathUtils::GetPersonalDataPath() / BASE_DATA_PATH;
|
|
|
|
return result;
|
2010-05-10 03:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Framework::CConfig::PathType CAppConfig::BuildConfigPath()
|
|
|
|
{
|
2012-11-14 05:14:08 +00:00
|
|
|
auto userPath(GetBasePath());
|
2010-05-10 03:12:24 +00:00
|
|
|
Framework::PathUtils::EnsurePathExists(userPath);
|
2012-11-14 05:14:08 +00:00
|
|
|
return userPath / CONFIG_FILENAME;
|
2010-05-10 03:12:24 +00:00
|
|
|
}
|