mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-29 06:07:56 +03:00

Fixed TR1 compilance. Input configuration support for Win32. Support for analog axis in PadMan. git-svn-id: http://svn.purei.org/purei/trunk@361 b36208d7-6611-0410-8bec-b1987f11c4a2
44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
#include "AppConfig.h"
|
|
#include "PathUtils.h"
|
|
|
|
#define DEFAULT_CONFIG_PATH ("config.xml")
|
|
|
|
using namespace Framework;
|
|
using namespace boost;
|
|
|
|
CAppConfig::CAppConfig() :
|
|
CConfig(BuildConfigPath())
|
|
{
|
|
|
|
}
|
|
|
|
CAppConfig::~CAppConfig()
|
|
{
|
|
|
|
}
|
|
|
|
CConfig::PathType CAppConfig::BuildConfigPath()
|
|
{
|
|
#if defined(MACOSX)
|
|
passwd* userInfo = getpwuid(getuid());
|
|
if(userInfo == NULL) return DEFAULT_CONFIG_PATH;
|
|
return string(userInfo->pw_dir) + "/Library/Preferences/com.vapps.Purei.xml";
|
|
#elif defined(WIN32)
|
|
CConfig::PathType userPath(PathUtils::GetRoamingDataPath() / L"Virtual Applications" / L"Purei");
|
|
PathUtils::EnsurePathExists(userPath);
|
|
// CConfig::PathType companyPath = userPath / L"Virtual Applications";
|
|
// CConfig::PathType productPath = companyPath / L"Purei";
|
|
// try
|
|
// {
|
|
// filesystem::create_directory(companyPath);
|
|
// filesystem::create_directory(productPath);
|
|
// }
|
|
// catch(...)
|
|
// {
|
|
// //Creation failed (maybe because it already exists)
|
|
// }
|
|
return (userPath / L"Config.xml");
|
|
#else
|
|
return DEFAULT_CONFIG_PATH;
|
|
#endif
|
|
}
|