Remove more uses of path.string() (#220)

This commit is contained in:
Pieter-Jan Briers
2026-06-04 04:30:24 +02:00
committed by GitHub
parent 5a3c6d1b74
commit d7a57eba6b
2 changed files with 10 additions and 6 deletions
+8 -5
View File
@@ -1,6 +1,7 @@
#include "../../input.hpp"
#include "../../device.hpp"
#include "../../internal.hpp"
#include "../../fs_helper.hpp"
#include <dolphin/pad.h>
#include <dolphin/si.h>
#include <SDL3/SDL_mouse.h>
@@ -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);
+2 -1
View File
@@ -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));