From 68644fe6d54390bed9e8731dc5e6f4831f2fb803 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 29 Dec 2024 19:03:27 +0100 Subject: [PATCH] PXI: Switch from boost::filesystem to std::filesystem --- source/processes/pxi_fs.hpp | 8 ++++---- source/processes/pxi_fs_host_file.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/processes/pxi_fs.hpp b/source/processes/pxi_fs.hpp index b1be44a..93c72de 100644 --- a/source/processes/pxi_fs.hpp +++ b/source/processes/pxi_fs.hpp @@ -4,8 +4,8 @@ #include -#include -#include +#include +#include #include namespace HLE { @@ -133,8 +133,8 @@ public: }; private: - const boost::filesystem::path path; - boost::filesystem::fstream stream; + const std::filesystem::path path; + std::fstream stream; Policy policy; diff --git a/source/processes/pxi_fs_host_file.cpp b/source/processes/pxi_fs_host_file.cpp index 04e5a2e..ffa6ae6 100644 --- a/source/processes/pxi_fs_host_file.cpp +++ b/source/processes/pxi_fs_host_file.cpp @@ -3,9 +3,9 @@ #include "pxi_fs_file_buffer_emu.hpp" -#include +#include -#include +#include #include @@ -25,7 +25,7 @@ HostFile::HostFile(std::string_view path, Policy policy) : path(std::begin(path) ResultAnd<> HostFile::Open(FileContext& context, OpenFlags flags) { context.logger.info("Attempting to open {} (create={})", path, flags.create); - if (!flags.create && !boost::filesystem::exists(path)) { + if (!flags.create && !std::filesystem::exists(path)) { return std::make_tuple(-1); } @@ -58,7 +58,7 @@ void HostFile::Close(/*FakeThread& thread*/) { ResultAnd HostFile::GetSize(FileContext& context) { context.logger.info("Attempting to get size of file {}", path); - uint64_t size = boost::filesystem::file_size(path); + uint64_t size = std::filesystem::file_size(path); return std::make_tuple(OS::RESULT_OK, size); } @@ -68,7 +68,7 @@ ResultAnd<> HostFile::SetSize(FakeThread& thread, uint64_t size) { // TODO: Does this zero-fill the file as expected? // TODO: Expected by whom? If these are not the 3DS semantics, we still would want to have deterministic buffer contents here! - boost::filesystem::resize_file(path, size); + std::filesystem::resize_file(path, size); return std::make_tuple(OS::RESULT_OK); }