Use std::filesystem::path

This commit is contained in:
ArtemisX64 2022-08-27 05:04:00 +09:00
parent c02db9d63f
commit dd62ed7f51
2 changed files with 5 additions and 4 deletions

View file

@ -216,4 +216,4 @@ struct CoreinitFSParsedPath
void coreinitFS_parsePath(CoreinitFSParsedPath* parsedPath, const char* path);
bool coreinitFS_checkNodeName(CoreinitFSParsedPath* parsedPath, sint32 index, const char* name);
char* coreinitFS_getNodeName(CoreinitFSParsedPath* parsedPath, sint32 index);
char* coreinitFS_getNodeName(CoreinitFSParsedPath* parsedPath, sint32 index);

View file

@ -8,6 +8,7 @@
#include <zarchive/zarchivereader.h>
#include "config/ActiveSettings.h"
#include <filesystem>
// detect format by reading file header/footer
CafeTitleFileType DetermineCafeSystemFileType(fs::path filePath)
@ -646,9 +647,9 @@ std::string TitleInfo::GetInstallPath() const
TitleId titleId = GetAppTitleId();
TitleIdParser tip(titleId);
std::string tmp;
std::filesystem::path path = "usr";
if (tip.IsSystemTitle())
tmp = fmt::format("sys/title/{:08x}/{:08x}", GetTitleIdHigh(titleId), GetTitleIdLow(titleId));
else
tmp = fmt::format("usr/title/{:08x}/{:08x}", GetTitleIdHigh(titleId), GetTitleIdLow(titleId));
path = "sys";
tmp = (path / "title" / fmt::format("{:08x}",GetTitleIdHigh(titleId)) / fmt::format("{:08x}", GetTitleIdLow(titleId))).string();
return tmp;
}