summaryrefslogtreecommitdiff
path: root/Source/Core/Common/NandPaths.cpp
diff options
context:
space:
mode:
authorAnthony <Helios747@users.noreply.github.com>2019-06-14 12:22:16 -0700
committerGitHub <noreply@github.com>2019-06-14 12:22:16 -0700
commit9cf6ba13dfa04e2ef402eef19cd67435e6849d29 (patch)
treeb87080969dd47a01c3a7845d65ef2afdef90928d /Source/Core/Common/NandPaths.cpp
parent59155b4d5ef891597294b22c1dab581d47c3ea0d (diff)
parent5b92d5076a0be89945fa0fc722749dd5fbfcdf4c (diff)
Merge pull request #8177 from lioncash/fmt
Common: Use fmt where applicable
Diffstat (limited to 'Source/Core/Common/NandPaths.cpp')
-rw-r--r--Source/Core/Common/NandPaths.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/Core/Common/NandPaths.cpp b/Source/Core/Common/NandPaths.cpp
index 390d95033c..ac57ccdcdc 100644
--- a/Source/Core/Common/NandPaths.cpp
+++ b/Source/Core/Common/NandPaths.cpp
@@ -9,6 +9,8 @@
#include <unordered_set>
#include <vector>
+#include <fmt/format.h>
+
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/StringUtil.h"
@@ -28,21 +30,20 @@ static std::string RootUserPath(std::optional<FromWhichRoot> from)
std::string GetImportTitlePath(u64 title_id, std::optional<FromWhichRoot> from)
{
- return RootUserPath(from) + StringFromFormat("/import/%08x/%08x",
- static_cast<u32>(title_id >> 32),
- static_cast<u32>(title_id));
+ return RootUserPath(from) + fmt::format("/import/{:08x}/{:08x}", static_cast<u32>(title_id >> 32),
+ static_cast<u32>(title_id));
}
std::string GetTicketFileName(u64 title_id, std::optional<FromWhichRoot> from)
{
- return StringFromFormat("%s/ticket/%08x/%08x.tik", RootUserPath(from).c_str(),
- static_cast<u32>(title_id >> 32), static_cast<u32>(title_id));
+ return fmt::format("{}/ticket/{:08x}/{:08x}.tik", RootUserPath(from),
+ static_cast<u32>(title_id >> 32), static_cast<u32>(title_id));
}
std::string GetTitlePath(u64 title_id, std::optional<FromWhichRoot> from)
{
- return StringFromFormat("%s/title/%08x/%08x", RootUserPath(from).c_str(),
- static_cast<u32>(title_id >> 32), static_cast<u32>(title_id));
+ return fmt::format("{}/title/{:08x}/{:08x}", RootUserPath(from), static_cast<u32>(title_id >> 32),
+ static_cast<u32>(title_id));
}
std::string GetTitleDataPath(u64 title_id, std::optional<FromWhichRoot> from)
@@ -62,7 +63,7 @@ std::string GetTMDFileName(u64 title_id, std::optional<FromWhichRoot> from)
std::string GetMiiDatabasePath(std::optional<FromWhichRoot> from)
{
- return StringFromFormat("%s/shared2/menu/FaceLib/RFL_DB.dat", RootUserPath(from).c_str());
+ return fmt::format("{}/shared2/menu/FaceLib/RFL_DB.dat", RootUserPath(from));
}
bool IsTitlePath(const std::string& path, std::optional<FromWhichRoot> from, u64* title_id)
@@ -111,7 +112,7 @@ std::string EscapeFileName(const std::string& filename)
for (char c : filename_with_escaped_double_underscores)
{
if ((c >= 0 && c <= 0x1F) || chars_to_replace.find(c) != chars_to_replace.end())
- result.append(StringFromFormat("__%02x__", c));
+ result.append(fmt::format("__{:02x}__", c));
else
result.push_back(c);
}