From dd62ed7f514e3b6dbd5f2da59dea569a95917979 Mon Sep 17 00:00:00 2001 From: ArtemisX64 Date: Sat, 27 Aug 2022 05:04:00 +0900 Subject: [PATCH] Use std::filesystem::path --- src/Cafe/Filesystem/fsc.h | 2 +- src/Cafe/TitleList/TitleInfo.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Cafe/Filesystem/fsc.h b/src/Cafe/Filesystem/fsc.h index d63b7c2d..972d5d0a 100644 --- a/src/Cafe/Filesystem/fsc.h +++ b/src/Cafe/Filesystem/fsc.h @@ -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); \ No newline at end of file +char* coreinitFS_getNodeName(CoreinitFSParsedPath* parsedPath, sint32 index); diff --git a/src/Cafe/TitleList/TitleInfo.cpp b/src/Cafe/TitleList/TitleInfo.cpp index fa20e6d9..3363a17b 100644 --- a/src/Cafe/TitleList/TitleInfo.cpp +++ b/src/Cafe/TitleList/TitleInfo.cpp @@ -8,6 +8,7 @@ #include #include "config/ActiveSettings.h" +#include // 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; }