Play-/Source/AppConfig.cpp
jpd002 14129468e4 Removed uses of CList, CEvent, CEventEx, CEventHandler.
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
2008-08-24 21:28:42 +00:00

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
}