[Base] Removed useless path_to_utf8 conversion while using fmt

Default filesystem::path formatter was added to fmt around 2022
This commit is contained in:
Gliniak 2024-12-13 19:04:31 +01:00
parent 3318ab5d4c
commit a295ec1bbd
18 changed files with 55 additions and 78 deletions

View File

@ -16,8 +16,6 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "third_party/fmt/include/fmt/chrono.h"
#include "third_party/fmt/include/fmt/format.h"
#include "third_party/imgui/imgui.h" #include "third_party/imgui/imgui.h"
#include "third_party/stb/stb_image_write.h" #include "third_party/stb/stb_image_write.h"
#include "third_party/tomlplusplus/toml.hpp" #include "third_party/tomlplusplus/toml.hpp"
@ -986,7 +984,7 @@ void EmulatorWindow::SaveImage(const std::filesystem::path& filepath,
const xe::ui::RawImage& image) { const xe::ui::RawImage& image) {
auto file = std::ofstream(filepath, std::ios::binary); auto file = std::ofstream(filepath, std::ios::binary);
if (!file.is_open()) { if (!file.is_open()) {
XELOGE("Failed to open file for writing: {}", xe::path_to_utf8(filepath)); XELOGE("Failed to open file for writing: {}", filepath);
return; return;
} }
@ -998,7 +996,7 @@ void EmulatorWindow::SaveImage(const std::filesystem::path& filepath,
&file, image.width, image.height, 4, image.data.data(), &file, image.width, image.height, 4, image.data.data(),
(int)image.stride); (int)image.stride);
if (result == 0) { if (result == 0) {
XELOGE("Failed to write PNG to file: {}", xe::path_to_utf8(filepath)); XELOGE("Failed to write PNG to file: {}", filepath);
return; return;
} }
} }
@ -1212,12 +1210,11 @@ void EmulatorWindow::ExtractZarchive() {
// delete incomplete output file // delete incomplete output file
std::filesystem::remove(abs_extract_dir, ec); std::filesystem::remove(abs_extract_dir, ec);
summary += summary += fmt::format("\nFailed: {}", zarchive_file_path);
fmt::format("\nFailed: {}", path_to_utf8(zarchive_file_path));
XELOGE("Failed to extract Zarchive package.", result); XELOGE("Failed to extract Zarchive package.", result);
} else { } else {
summary += fmt::format("\nSuccess: {}", path_to_utf8(abs_extract_dir)); summary += fmt::format("\nSuccess: {}", abs_extract_dir);
} }
} }
@ -1313,11 +1310,11 @@ void EmulatorWindow::CreateZarchive() {
// delete incomplete output file // delete incomplete output file
std::filesystem::remove(zarchive_file, ec); std::filesystem::remove(zarchive_file, ec);
summary += fmt::format("\nFailed: {}", path_to_utf8(abs_content_dir)); summary += fmt::format("\nFailed: {}", abs_content_dir);
XELOGE("Failed to create Zarchive package.", result); XELOGE("Failed to create Zarchive package.", result);
} else { } else {
summary += fmt::format("\nSuccess: {}", path_to_utf8(zarchive_file)); summary += fmt::format("\nSuccess: {}", zarchive_file);
} }
} }
@ -1962,8 +1959,7 @@ xe::X_STATUS EmulatorWindow::RunTitle(
path_to_file.empty() ? "empty" : "invalid"); path_to_file.empty() ? "empty" : "invalid");
if (!path_to_file.empty() && !titleExists) { if (!path_to_file.empty() && !titleExists) {
log_msg.append( log_msg.append(fmt::format("\nProvided Path: {}", path_to_file));
fmt::format("\nProvided Path: {}", xe::path_to_utf8(path_to_file)));
} }
if (ec) { if (ec) {

View File

@ -61,8 +61,6 @@
#include "xenia/hid/xinput/xinput_hid.h" #include "xenia/hid/xinput/xinput_hid.h"
#endif // XE_PLATFORM_WIN32 #endif // XE_PLATFORM_WIN32
#include "third_party/fmt/include/fmt/format.h"
DEFINE_string(apu, "any", "Audio system. Use: [any, nop, sdl, xaudio2]", "APU"); DEFINE_string(apu, "any", "Audio system. Use: [any, nop, sdl, xaudio2]", "APU");
DEFINE_string(gpu, "any", "Graphics system. Use: [any, d3d12, vulkan, null]", DEFINE_string(gpu, "any", "Graphics system. Use: [any, d3d12, vulkan, null]",
"GPU"); "GPU");
@ -408,7 +406,7 @@ bool EmulatorApp::OnInitialize() {
} }
} }
storage_root = std::filesystem::absolute(storage_root); storage_root = std::filesystem::absolute(storage_root);
XELOGI("Storage root: {}", xe::path_to_utf8(storage_root)); XELOGI("Storage root: {}", storage_root);
config::SetupConfig(storage_root); config::SetupConfig(storage_root);
@ -423,7 +421,7 @@ bool EmulatorApp::OnInitialize() {
} }
} }
content_root = std::filesystem::absolute(content_root); content_root = std::filesystem::absolute(content_root);
XELOGI("Content root: {}", xe::path_to_utf8(content_root)); XELOGI("Content root: {}", content_root);
std::filesystem::path cache_root = cvars::cache_root; std::filesystem::path cache_root = cvars::cache_root;
if (cache_root.empty()) { if (cache_root.empty()) {
@ -438,7 +436,7 @@ bool EmulatorApp::OnInitialize() {
} }
} }
cache_root = std::filesystem::absolute(cache_root); cache_root = std::filesystem::absolute(cache_root);
XELOGI("Host cache root: {}", xe::path_to_utf8(cache_root)); XELOGI("Host cache root: {}", cache_root);
if (cvars::discord) { if (cvars::discord) {
discord::DiscordPresence::Initialize(); discord::DiscordPresence::Initialize();

View File

@ -15,6 +15,7 @@
#include <string> #include <string>
#include "third_party/fmt/include/fmt/format.h" #include "third_party/fmt/include/fmt/format.h"
#include "third_party/fmt/include/fmt/std.h"
#include "xenia/base/string.h" #include "xenia/base/string.h"
namespace xe { namespace xe {

View File

@ -47,7 +47,7 @@ toml::parse_result ParseConfig(const std::filesystem::path& config_path) {
return ParseFile(config_path); return ParseFile(config_path);
} catch (toml::parse_error& e) { } catch (toml::parse_error& e) {
xe::FatalError(fmt::format("Failed to parse config file '{}':\n\n{}", xe::FatalError(fmt::format("Failed to parse config file '{}':\n\n{}",
xe::path_to_utf8(config_path), e.what())); config_path, e.what()));
return toml::parse_result(); return toml::parse_result();
} }
} }
@ -118,7 +118,7 @@ void ReadConfig(const std::filesystem::path& file_path,
cvar::IConfigVarUpdate::ApplyUpdates(config_defaults_date); cvar::IConfigVarUpdate::ApplyUpdates(config_defaults_date);
} }
XELOGI("Loaded config: {}", xe::path_to_utf8(file_path)); XELOGI("Loaded config: {}", file_path);
} }
void ReadGameConfig(const std::filesystem::path& file_path) { void ReadGameConfig(const std::filesystem::path& file_path) {
@ -136,7 +136,7 @@ void ReadGameConfig(const std::filesystem::path& file_path) {
config_var->LoadConfigValue(config_key_node.node()); config_var->LoadConfigValue(config_key_node.node());
} }
} }
XELOGI("Loaded game config: {}", xe::path_to_utf8(file_path)); XELOGI("Loaded game config: {}", file_path);
} }
void SaveConfig() { void SaveConfig() {
@ -236,7 +236,7 @@ void SaveConfig() {
auto handle = xe::filesystem::OpenFile(config_path, "wb"); auto handle = xe::filesystem::OpenFile(config_path, "wb");
if (!handle) { if (!handle) {
XELOGE("Failed to open '{}' for writing.", xe::path_to_utf8(config_path)); XELOGE("Failed to open '{}' for writing.", config_path);
} else { } else {
fwrite(sb.buffer(), 1, sb.length(), handle); fwrite(sb.buffer(), 1, sb.length(), handle);
fclose(handle); fclose(handle);

View File

@ -68,13 +68,11 @@ class TestSuite {
bool Load() { bool Load() {
if (!ReadMap()) { if (!ReadMap()) {
XELOGE("Unable to read map for test {}", XELOGE("Unable to read map for test {}", src_file_path_);
xe::path_to_utf8(src_file_path_));
return false; return false;
} }
if (!ReadAnnotations()) { if (!ReadAnnotations()) {
XELOGE("Unable to read annotations for test {}", XELOGE("Unable to read annotations for test {}", src_file_path_);
xe::path_to_utf8(src_file_path_));
return false; return false;
} }
return true; return true;
@ -152,7 +150,7 @@ class TestSuite {
current_test_case = FindTestCase(label); current_test_case = FindTestCase(label);
if (!current_test_case) { if (!current_test_case) {
XELOGE("Test case {} not found in corresponding map for {}", label, XELOGE("Test case {} not found in corresponding map for {}", label,
xe::path_to_utf8(src_file_path_)); src_file_path_);
return false; return false;
} }
} else if (strlen(start) > 3 && start[0] == '#' && start[1] == '_') { } else if (strlen(start) > 3 && start[0] == '#' && start[1] == '_') {
@ -167,8 +165,7 @@ class TestSuite {
value.erase(value.end() - 1); value.erase(value.end() - 1);
} }
if (!current_test_case) { if (!current_test_case) {
XELOGE("Annotation outside of test case in {}", XELOGE("Annotation outside of test case in {}", src_file_path_);
xe::path_to_utf8(src_file_path_));
return false; return false;
} }
current_test_case->annotations.emplace_back(key, value); current_test_case->annotations.emplace_back(key, value);
@ -221,8 +218,7 @@ class TestRunner {
// Load the binary module. // Load the binary module.
auto module = std::make_unique<xe::cpu::RawModule>(processor_.get()); auto module = std::make_unique<xe::cpu::RawModule>(processor_.get());
if (!module->LoadFile(START_ADDRESS, suite.bin_file_path())) { if (!module->LoadFile(START_ADDRESS, suite.bin_file_path())) {
XELOGE("Unable to load test binary {}", XELOGE("Unable to load test binary {}", suite.bin_file_path());
xe::path_to_utf8(suite.bin_file_path()));
return false; return false;
} }
processor_->AddModule(std::move(module)); processor_->AddModule(std::move(module));
@ -449,7 +445,7 @@ bool RunTests(const std::string_view test_name) {
continue; continue;
} }
if (!test_suite.Load()) { if (!test_suite.Load()) {
XELOGE("TEST SUITE {} FAILED TO LOAD", xe::path_to_utf8(test_path)); XELOGE("TEST SUITE {} FAILED TO LOAD", test_path);
load_failed = true; load_failed = true;
continue; continue;
} }

View File

@ -421,8 +421,7 @@ X_STATUS Emulator::MountPath(const std::filesystem::path& path,
return X_STATUS_NO_SUCH_FILE; return X_STATUS_NO_SUCH_FILE;
} }
if (!file_system_->RegisterDevice(std::move(device))) { if (!file_system_->RegisterDevice(std::move(device))) {
XELOGE("Unable to register the input file to {}.", XELOGE("Unable to register the input file to {}.", mount_path);
xe::path_to_utf8(mount_path));
return X_STATUS_NO_SUCH_FILE; return X_STATUS_NO_SUCH_FILE;
} }
@ -658,8 +657,7 @@ X_STATUS Emulator::DataMigration(const uint64_t xuid) {
if (ec) { if (ec) {
failure_count++; failure_count++;
XELOGW("{}: Moving from: {} to: {} failed! Error message: {} ({:08X})", XELOGW("{}: Moving from: {} to: {} failed! Error message: {} ({:08X})",
__func__, xe::path_to_utf8(previous_path), __func__, previous_path, path / content_type.name, ec.message(),
xe::path_to_utf8(path / content_type.name), ec.message(),
ec.value()); ec.value());
} }
} }
@ -681,8 +679,8 @@ X_STATUS Emulator::DataMigration(const uint64_t xuid) {
if (ec) { if (ec) {
failure_count++; failure_count++;
XELOGW("{}: Copying from: {} to: {} failed! Error message: {} ({:08X})", XELOGW("{}: Copying from: {} to: {} failed! Error message: {} ({:08X})",
__func__, xe::path_to_utf8(title.path / title.name / "Headers"), __func__, title.path / title.name / "Headers", xuid_path,
xe::path_to_utf8(xuid_path), ec.message(), ec.value()); ec.message(), ec.value());
} }
const auto header_types = const auto header_types =
@ -704,8 +702,8 @@ X_STATUS Emulator::DataMigration(const uint64_t xuid) {
failure_count++; failure_count++;
XELOGW( XELOGW(
"{}: Copying from: {} to: {} failed! Error message: {} ({:08X})", "{}: Copying from: {} to: {} failed! Error message: {} ({:08X})",
__func__, xe::path_to_utf8(title.path / title.name / "Headers"), __func__, title.path / title.name / "Headers", common_path,
xe::path_to_utf8(common_path), ec.message(), ec.value()); ec.message(), ec.value());
} }
} }
@ -740,8 +738,7 @@ X_STATUS Emulator::DataMigration(const uint64_t xuid) {
if (ec) { if (ec) {
failure_count++; failure_count++;
XELOGW("{}: Moving from: {} to: {} failed! Error message: {} ({:08X})", XELOGW("{}: Moving from: {} to: {} failed! Error message: {} ({:08X})",
__func__, xe::path_to_utf8(path_from), __func__, path_from, path_to_profile_data / title.name,
xe::path_to_utf8(path_to_profile_data / title.name),
ec.message(), ec.value()); ec.message(), ec.value());
} else { } else {
std::error_code ec; std::error_code ec;
@ -812,7 +809,7 @@ X_STATUS Emulator::InstallContentPackage(
installation_info.installation_path = installation_info.installation_path =
fmt::format("{:016X}/{:08X}/{:08X}/{}", xuid, dev->title_id(), fmt::format("{:016X}/{:08X}/{:08X}/{}", xuid, dev->title_id(),
dev->content_type(), xe::path_to_utf8(path.filename())); dev->content_type(), path.filename());
installation_info.content_name = installation_info.content_name =
xe::to_utf8(dev->content_header().display_name()); xe::to_utf8(dev->content_header().display_name());
@ -1401,20 +1398,19 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,
XELOGI("Loading module {}", module_path); XELOGI("Loading module {}", module_path);
auto module = kernel_state_->LoadUserModule(module_path); auto module = kernel_state_->LoadUserModule(module_path);
if (!module) { if (!module) {
XELOGE("Failed to load user module {}", xe::path_to_utf8(path)); XELOGE("Failed to load user module {}", path);
return X_STATUS_NOT_FOUND; return X_STATUS_NOT_FOUND;
} }
X_RESULT result = kernel_state_->ApplyTitleUpdate(module); X_RESULT result = kernel_state_->ApplyTitleUpdate(module);
if (XFAILED(result)) { if (XFAILED(result)) {
XELOGE("Failed to apply title update! Cannot run module {}", XELOGE("Failed to apply title update! Cannot run module {}", path);
xe::path_to_utf8(path));
return result; return result;
} }
result = kernel_state_->FinishLoadingUserModule(module); result = kernel_state_->FinishLoadingUserModule(module);
if (XFAILED(result)) { if (XFAILED(result)) {
XELOGE("Failed to initialize user module {}", xe::path_to_utf8(path)); XELOGE("Failed to initialize user module {}", path);
return result; return result;
} }
// Grab the current title ID. // Grab the current title ID.

View File

@ -244,7 +244,7 @@ void PipelineCache::InitializeShaderStorage(
XELOGE( XELOGE(
"Failed to create the shareable shader storage directory, persistent " "Failed to create the shareable shader storage directory, persistent "
"shader storage will be disabled: {}", "shader storage will be disabled: {}",
xe::path_to_utf8(shader_storage_shareable_root)); shader_storage_shareable_root);
return; return;
} }
} }
@ -267,7 +267,7 @@ void PipelineCache::InitializeShaderStorage(
XELOGE( XELOGE(
"Failed to open the Direct3D 12 pipeline description storage file for " "Failed to open the Direct3D 12 pipeline description storage file for "
"writing, persistent shader storage will be disabled: {}", "writing, persistent shader storage will be disabled: {}",
xe::path_to_utf8(pipeline_storage_file_path)); pipeline_storage_file_path);
return; return;
} }
pipeline_storage_file_flush_needed_ = false; pipeline_storage_file_flush_needed_ = false;
@ -355,7 +355,7 @@ void PipelineCache::InitializeShaderStorage(
XELOGE( XELOGE(
"Failed to open the guest shader storage file for writing, persistent " "Failed to open the guest shader storage file for writing, persistent "
"shader storage will be disabled: {}", "shader storage will be disabled: {}",
xe::path_to_utf8(shader_storage_file_path)); shader_storage_file_path);
fclose(pipeline_storage_file_); fclose(pipeline_storage_file_);
pipeline_storage_file_ = nullptr; pipeline_storage_file_ = nullptr;
return; return;

View File

@ -96,8 +96,7 @@ int shader_compiler_main(const std::vector<std::string>& args) {
auto input_file = filesystem::OpenFile(cvars::shader_input, "rb"); auto input_file = filesystem::OpenFile(cvars::shader_input, "rb");
if (!input_file) { if (!input_file) {
XELOGE("Unable to open input file: {}", XELOGE("Unable to open input file: {}", cvars::shader_input);
xe::path_to_utf8(cvars::shader_input));
return 1; return 1;
} }
size_t input_file_size = std::filesystem::file_size(cvars::shader_input); size_t input_file_size = std::filesystem::file_size(cvars::shader_input);
@ -105,8 +104,7 @@ int shader_compiler_main(const std::vector<std::string>& args) {
fread(ucode_dwords.data(), 4, ucode_dwords.size(), input_file); fread(ucode_dwords.data(), 4, ucode_dwords.size(), input_file);
fclose(input_file); fclose(input_file);
XELOGI("Opened {} as a {} shader, {} words ({} bytes).", XELOGI("Opened {} as a {} shader, {} words ({} bytes).", cvars::shader_input,
xe::path_to_utf8(cvars::shader_input),
shader_type == xenos::ShaderType::kVertex ? "vertex" : "pixel", shader_type == xenos::ShaderType::kVertex ? "vertex" : "pixel",
ucode_dwords.size(), ucode_dwords.size() * 4); ucode_dwords.size(), ucode_dwords.size() * 4);

View File

@ -65,7 +65,7 @@ int TraceDump::Main(const std::vector<std::string>& args) {
// Normalize the path and make absolute. // Normalize the path and make absolute.
auto abs_path = std::filesystem::absolute(path); auto abs_path = std::filesystem::absolute(path);
XELOGI("Loading trace file {}...", xe::path_to_utf8(abs_path)); XELOGI("Loading trace file {}...", abs_path);
if (!Setup()) { if (!Setup()) {
XELOGE("Unable to setup trace dump tool"); XELOGE("Unable to setup trace dump tool");

View File

@ -55,7 +55,7 @@ bool TraceReader::Open(const std::string_view path) {
return false; return false;
} }
XELOGI("Mapped {}b trace from {}", trace_size_, xe::path_to_utf8(path)); XELOGI("Mapped {}b trace from {}", trace_size_, path);
XELOGI(" Version: {}", header->version); XELOGI(" Version: {}", header->version);
auto commit_str = std::string(header->build_commit_sha, auto commit_str = std::string(header->build_commit_sha,
xe::countof(header->build_commit_sha)); xe::countof(header->build_commit_sha));

View File

@ -129,12 +129,11 @@ void SDLInputDriver::LoadGameControllerDB() {
if (!std::filesystem::exists(cvars::mappings_file)) { if (!std::filesystem::exists(cvars::mappings_file)) {
XELOGW("SDL GameControllerDB: file '{}' does not exist.", XELOGW("SDL GameControllerDB: file '{}' does not exist.",
xe::path_to_utf8(cvars::mappings_file)); cvars::mappings_file);
return; return;
} }
XELOGI("SDL GameControllerDB: Loading {}", XELOGI("SDL GameControllerDB: Loading {}", cvars::mappings_file);
xe::path_to_utf8(cvars::mappings_file));
uint32_t updated_mappings = 0; uint32_t updated_mappings = 0;
uint32_t added_mappings = 0; uint32_t added_mappings = 0;

View File

@ -263,7 +263,7 @@ bool ProfileManager::MountProfile(const uint64_t xuid) {
XELOGE( XELOGE(
"MountProfile: Unable to mount {} profile; file not found or " "MountProfile: Unable to mount {} profile; file not found or "
"corrupted.", "corrupted.",
xe::path_to_utf8(profile_path)); profile_path);
return false; return false;
} }
return kernel_state_->file_system()->RegisterDevice(std::move(device)); return kernel_state_->file_system()->RegisterDevice(std::move(device));

View File

@ -44,7 +44,7 @@ void PatchDB::LoadPatches() {
if (!std::regex_match(path_to_utf8(patch_file.name), if (!std::regex_match(path_to_utf8(patch_file.name),
patch_filename_regex_)) { patch_filename_regex_)) {
XELOGE("PatchDB: Skipped loading file {} due to incorrect filename", XELOGE("PatchDB: Skipped loading file {} due to incorrect filename",
path_to_utf8(patch_file.name)); patch_file.name);
continue; continue;
} }
@ -65,8 +65,7 @@ PatchFileEntry PatchDB::ReadPatchFile(
try { try {
patch_toml_fields = ParseFile(file_path); patch_toml_fields = ParseFile(file_path);
} catch (...) { } catch (...) {
XELOGE("PatchDB: Cannot load patch file: {}", XELOGE("PatchDB: Cannot load patch file: {}", file_path.filename());
path_to_utf8(file_path.filename()));
patch_file.title_id = -1; patch_file.title_id = -1;
return patch_file; return patch_file;
}; };
@ -76,8 +75,7 @@ PatchFileEntry PatchDB::ReadPatchFile(
auto hashes_node = patch_toml_fields.get("hash"); auto hashes_node = patch_toml_fields.get("hash");
if (!title_name || !title_id || !hashes_node) { if (!title_name || !title_id || !hashes_node) {
XELOGE("PatchDB: Cannot load patch file: {}", XELOGE("PatchDB: Cannot load patch file: {}", file_path.filename());
path_to_utf8(file_path.filename()));
patch_file.title_id = -1; patch_file.title_id = -1;
return patch_file; return patch_file;
} }

View File

@ -70,8 +70,7 @@ void PluginLoader::LoadTitleConfig(const uint32_t title_id) {
try { try {
plugins_config = ParseFile(title_plugins_config); plugins_config = ParseFile(title_plugins_config);
} catch (...) { } catch (...) {
XELOGE("Plugins: Cannot load plugin file {}", XELOGE("Plugins: Cannot load plugin file {}", title_plugins_config);
path_to_utf8(title_plugins_config));
return; return;
} }
@ -82,8 +81,7 @@ void PluginLoader::LoadTitleConfig(const uint32_t title_id) {
plugins_config.get_as<std::string>("title_id")->get(); plugins_config.get_as<std::string>("title_id")->get();
if (!plugins_config.contains("plugin")) { if (!plugins_config.contains("plugin")) {
XELOGE("Plugins: Cannot find [[plugin]] table in {}", XELOGE("Plugins: Cannot find [[plugin]] table in {}", title_plugins_config);
path_to_utf8(title_plugins_config));
return; return;
} }
@ -122,8 +120,7 @@ void PluginLoader::LoadTitleConfig(const uint32_t title_id) {
const std::string file = const std::string file =
fmt::format("plugins\\{:08X}\\plugins.toml", title_id); fmt::format("plugins\\{:08X}\\plugins.toml", title_id);
XELOGE("Hash error! skipping plugin {} in: {}", entry.name, XELOGE("Hash error! skipping plugin {} in: {}", entry.name, file);
path_to_utf8(file));
continue; continue;
} }

View File

@ -311,7 +311,7 @@ bool ImGuiDrawer::LoadWindowsFont(ImGuiIO& io, ImFontConfig& font_config,
io.Fonts->Build(); io.Fonts->Build();
// Something went wrong while loading custom font. Probably corrupted. // Something went wrong while loading custom font. Probably corrupted.
if (!font->IsLoaded()) { if (!font->IsLoaded()) {
XELOGE("Failed to load custom font: {}", xe::path_to_utf8(font_path)); XELOGE("Failed to load custom font: {}", font_path);
io.Fonts->Clear(); io.Fonts->Clear();
} }
CoTaskMemFree(static_cast<void*>(fonts_dir)); CoTaskMemFree(static_cast<void*>(fonts_dir));

View File

@ -18,8 +18,7 @@ namespace vfs {
std::unique_ptr<Device> XContentContainerDevice::CreateContentDevice( std::unique_ptr<Device> XContentContainerDevice::CreateContentDevice(
const std::string_view mount_path, const std::filesystem::path& host_path) { const std::string_view mount_path, const std::filesystem::path& host_path) {
if (!std::filesystem::exists(host_path)) { if (!std::filesystem::exists(host_path)) {
XELOGE("Path to XContent container does not exist: {}", XELOGE("Path to XContent container does not exist: {}", host_path);
xe::path_to_utf8(host_path));
return nullptr; return nullptr;
} }
@ -75,8 +74,7 @@ XContentContainerDevice::~XContentContainerDevice() {}
bool XContentContainerDevice::Initialize() { bool XContentContainerDevice::Initialize() {
if (!std::filesystem::exists(host_path_)) { if (!std::filesystem::exists(host_path_)) {
XELOGE("Path to XContent container does not exist: {}", XELOGE("Path to XContent container does not exist: {}", host_path_);
xe::path_to_utf8(host_path_));
return false; return false;
} }
@ -84,7 +82,7 @@ bool XContentContainerDevice::Initialize() {
return false; return false;
} }
XELOGI("Loading XContent header file: {}", xe::path_to_utf8(host_path_)); XELOGI("Loading XContent header file: {}", host_path_);
auto header_file = xe::filesystem::OpenFile(host_path_, "rb"); auto header_file = xe::filesystem::OpenFile(host_path_, "rb");
if (!header_file) { if (!header_file) {
XELOGE("Error opening XContent header file."); XELOGE("Error opening XContent header file.");

View File

@ -34,7 +34,7 @@ SvodContainerDevice::Result SvodContainerDevice::LoadHostFiles(
data_fragment_path += ".data"; data_fragment_path += ".data";
if (!std::filesystem::exists(data_fragment_path)) { if (!std::filesystem::exists(data_fragment_path)) {
XELOGE("STFS container is multi-file, but path {} does not exist.", XELOGE("STFS container is multi-file, but path {} does not exist.",
xe::path_to_utf8(data_fragment_path)); data_fragment_path);
return Result::kFileMismatch; return Result::kFileMismatch;
} }
@ -57,7 +57,7 @@ SvodContainerDevice::Result SvodContainerDevice::LoadHostFiles(
auto path = fragment.path / fragment.name; auto path = fragment.path / fragment.name;
auto file = xe::filesystem::OpenFile(path, "rb"); auto file = xe::filesystem::OpenFile(path, "rb");
if (!file) { if (!file) {
XELOGI("Failed to map SVOD file {}.", xe::path_to_utf8(path)); XELOGI("Failed to map SVOD file {}.", path);
CloseFiles(); CloseFiles();
return Result::kReadError; return Result::kReadError;
} }

View File

@ -32,7 +32,7 @@ DEFINE_transient_path(dump_path, "",
int vfs_dump_main(const std::vector<std::string>& args) { int vfs_dump_main(const std::vector<std::string>& args) {
if (cvars::source.empty() || cvars::dump_path.empty()) { if (cvars::source.empty() || cvars::dump_path.empty()) {
XELOGE("Usage: {} [source] [dump_path]", xe::path_to_utf8(args[0])); XELOGE("Usage: {} [source] [dump_path]", args[0]);
return 1; return 1;
} }