2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 20:27:43 +00:00

Humungous refactor

This commit is contained in:
Jack Andersen
2016-03-04 13:02:44 -10:00
parent 2a7ae959fa
commit 31fa668e78
62 changed files with 782 additions and 782 deletions

View File

@@ -1,14 +1,14 @@
#include "HECL/Runtime.hpp"
#include <LogVisor/LogVisor.hpp>
#include "hecl/Runtime.hpp"
#include "logvisor/logvisor.hpp"
#if _WIN32
#include <ShlObj.h>
#endif
namespace HECL
namespace hecl
{
namespace Runtime
{
static LogVisor::LogModule Log("FileStoreManager");
static logvisor::Module Log("FileStoreManager");
FileStoreManager::FileStoreManager(const SystemString& domain)
: m_domain(domain)
@@ -16,28 +16,28 @@ FileStoreManager::FileStoreManager(const SystemString& domain)
#if _WIN32
WCHAR home[MAX_PATH];
if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, home)))
Log.report(LogVisor::FatalError, _S("unable to locate profile for file store"));
Log.report(logvisor::Fatal, _S("unable to locate profile for file store"));
SystemString path(home);
path += _S("/.heclrun");
HECL::MakeDir(path.c_str());
hecl::MakeDir(path.c_str());
path += _S('/') + domain;
HECL::MakeDir(path.c_str());
hecl::MakeDir(path.c_str());
m_storeRoot = path;
#else
const char* home = getenv("HOME");
if (!home)
Log.report(LogVisor::FatalError, "unable to locate $HOME for file store");
Log.report(logvisor::Fatal, "unable to locate $HOME for file store");
std::string path(home);
path += "/.heclrun";
if (mkdir(path.c_str(), 0755) && errno != EEXIST)
Log.report(LogVisor::FatalError, "unable to mkdir at %s", path.c_str());
Log.report(logvisor::Fatal, "unable to mkdir at %s", path.c_str());
path += '/' + domain;
if (mkdir(path.c_str(), 0755) && errno != EEXIST)
Log.report(LogVisor::FatalError, "unable to mkdir at %s", path.c_str());
Log.report(logvisor::Fatal, "unable to mkdir at %s", path.c_str());
m_storeRoot = path;
#endif
}