2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:47:42 +00:00

Use UTF-8 exclusively internally

This removes SystemString, SystemChar, etc.
All filepaths and log strings are assumed to be UTF-8,
with conversions to UTF-16 for Windows APIs as appropriate.

Updates amuse, athena, boo, kabufua and nod
This commit is contained in:
2021-06-30 14:20:45 -04:00
parent 6e12554026
commit 9ca1a38171
160 changed files with 2029 additions and 2753 deletions

View File

@@ -15,22 +15,22 @@ using namespace Windows::Storage;
namespace hecl::Runtime {
static logvisor::Module Log("FileStoreManager");
FileStoreManager::FileStoreManager(SystemStringView domain) : m_domain(domain) {
FileStoreManager::FileStoreManager(std::string_view domain) : m_domain(domain) {
#if _WIN32
#if !WINDOWS_STORE
WCHAR home[MAX_PATH];
if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, home)))
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to locate profile for file store")));
Log.report(logvisor::Fatal, FMT_STRING("unable to locate profile for file store"));
SystemString path(home);
std::string path = nowide::narrow(home);
#else
StorageFolder ^ cacheFolder = ApplicationData::Current->LocalCacheFolder;
SystemString path(cacheFolder->Path->Data());
std::string path(cacheFolder->Path->Data());
#endif
path += _SYS_STR("/.heclrun");
path += "/.heclrun";
hecl::MakeDir(path.c_str());
path += _SYS_STR('/');
path += '/';
path += domain.data();
hecl::MakeDir(path.c_str());