From 74be25b01f755a3f8f12410b8cc24d49e59e7ee4 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Wed, 3 Jun 2026 18:00:12 +0200 Subject: [PATCH] Remove more uses of path.string() --- lib/dolphin/pad/pad.cpp | 13 ++++++++----- lib/gfx/pipeline_cache.cpp | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/dolphin/pad/pad.cpp b/lib/dolphin/pad/pad.cpp index b88f265c16..2d7f795689 100644 --- a/lib/dolphin/pad/pad.cpp +++ b/lib/dolphin/pad/pad.cpp @@ -1,6 +1,7 @@ #include "../../input.hpp" #include "../../device.hpp" #include "../../internal.hpp" +#include "../../fs_helper.hpp" #include #include #include @@ -1283,7 +1284,8 @@ constexpr int32_t k_keyboardVersion = 3; static void load_keyboard_bindings() { const auto filePath = std::filesystem::path{aurora::g_config.userPath} / "keyboard_bindings.dat"; - SDL_IOStream* file = SDL_IOFromFile(filePath.string().c_str(), "rb"); + const auto pathString = fs_path_to_string(filePath); + SDL_IOStream* file = SDL_IOFromFile(pathString.c_str(), "rb"); if (file == nullptr) { return; } @@ -1353,9 +1355,10 @@ static void load_keyboard_bindings() { static void save_keyboard_bindings() { const auto filePath = std::filesystem::path{aurora::g_config.userPath} / "keyboard_bindings.dat"; - SDL_IOStream* file = SDL_IOFromFile(filePath.string().c_str(), "wb"); + const auto pathString = fs_path_to_string(filePath); + SDL_IOStream* file = SDL_IOFromFile(pathString.c_str(), "wb"); if (file == nullptr) { - aurora::input::Log.warn("save_keyboard_bindings: failed to open {} for writing", filePath.string()); + aurora::input::Log.warn("save_keyboard_bindings: failed to open {} for writing", pathString); return; } @@ -1386,7 +1389,7 @@ void PADSerializeMappings() { const auto filePath = basePath / fmt::format("{}_{:04X}_{:04X}.controller", aurora::input::controller_name(controller.m_index), controller.m_vid, controller.m_pid); - std::string filePathStr = filePath.string(); + std::string filePathStr = fs_path_to_string(filePath); // don't truncate the file if it already exists const char* openMode = std::filesystem::exists(filePath) ? "r+b" : "wb"; @@ -1405,7 +1408,7 @@ void PADSerializeMappings() { // start writing data at next 32-byte aligned offset const int64_t dataStart = SDL_TellIO(file) + 31 & ~31; if (dataStart == -1) { - aurora::input::Log.warn("Unable to seek in controller bindings! Path: \"{}\"", filePath.string()); + aurora::input::Log.warn("Unable to seek in controller bindings! Path: \"{}\"", filePathStr); return; } SDL_SeekIO(file, dataStart, SDL_IO_SEEK_SET); diff --git a/lib/gfx/pipeline_cache.cpp b/lib/gfx/pipeline_cache.cpp index 633cc6441f..9c8fc5c2a7 100644 --- a/lib/gfx/pipeline_cache.cpp +++ b/lib/gfx/pipeline_cache.cpp @@ -1,6 +1,7 @@ #include "pipeline_cache.hpp" #include "clear.hpp" +#include "../fs_helper.hpp" #include "../gx/pipeline.hpp" #include "../sqlite_utils.hpp" #include "../webgpu/gpu.hpp" @@ -227,7 +228,7 @@ static bool prepare_pipeline_cache_db() { return true; } - const auto path = (std::filesystem::path{g_config.cachePath} / "pipeline_cache.db").string(); + const auto path = fs_path_to_string(std::filesystem::path{g_config.cachePath} / "pipeline_cache.db"); auto ret = sqlite3_open(path.c_str(), &g_pipelineCacheDb); if (ret != SQLITE_OK) { Log.error("Failed to open pipeline cache database: {}", sqlite3_errmsg(g_pipelineCacheDb));