VERY experimental Nintendo Switch 2 emulator
C++
Service.FS: Rename FileSys::Directory to DirectoryBackend
Yuri Kunde Schlesnerd51afab0bc3a
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txtindex 463f14eeec..c0ebd1c7e7 100644--- a/src/core/CMakeLists.txt+++ b/src/core/CMakeLists.txt@@ -99,7 +99,7 @@ set(HEADERSfile_sys/file.hfile_sys/file_romfs.hfile_sys/file_sdmc.h- file_sys/directory.h+ file_sys/directory_backend.hfile_sys/directory_romfs.hfile_sys/directory_sdmc.hhle/kernel/address_arbiter.hdiff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.hindex 0558698f69..49a3103838 100644--- a/src/core/file_sys/archive_backend.h+++ b/src/core/file_sys/archive_backend.h@@ -11,7 +11,7 @@#include "common/bit_field.h"#include "core/file_sys/file.h"-#include "core/file_sys/directory.h"+#include "core/file_sys/directory_backend.h"#include "core/mem_map.h"#include "core/hle/kernel/kernel.h"@@ -219,7 +219,7 @@ public:* @param path Path relative to the archive* @return Opened directory, or nullptr*/- virtual std::unique_ptr<Directory> OpenDirectory(const Path& path) const = 0;+ virtual std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const = 0;/*** Read data from the archivediff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cppindex 74974c2dfa..8db7d69c5e 100644--- a/src/core/file_sys/archive_romfs.cpp+++ b/src/core/file_sys/archive_romfs.cpp@@ -78,8 +78,8 @@ bool Archive_RomFS::RenameDirectory(const FileSys::Path& src_path, const FileSys* @param path Path relative to the archive* @return Opened directory, or nullptr*/-std::unique_ptr<Directory> Archive_RomFS::OpenDirectory(const Path& path) const {- return std::unique_ptr<Directory>(new Directory_RomFS);+std::unique_ptr<DirectoryBackend> Archive_RomFS::OpenDirectory(const Path& path) const {+ return std::unique_ptr<DirectoryBackend>(new Directory_RomFS);}/**diff --git a/src/core/file_sys/archive_romfs.h b/src/core/file_sys/archive_romfs.hindex 91505da492..5a8a6b04d2 100644--- a/src/core/file_sys/archive_romfs.h+++ b/src/core/file_sys/archive_romfs.h@@ -74,7 +74,7 @@ public:* @param path Path relative to the archive* @return Opened directory, or nullptr*/- std::unique_ptr<Directory> OpenDirectory(const Path& path) const override;+ std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const override;/*** Read data from the archivediff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cppindex 9e524b60e8..9d26d22852 100644--- a/src/core/file_sys/archive_sdmc.cpp+++ b/src/core/file_sys/archive_sdmc.cpp@@ -97,12 +97,12 @@ bool Archive_SDMC::RenameDirectory(const FileSys::Path& src_path, const FileSys:* @param path Path relative to the archive* @return Opened directory, or nullptr*/-std::unique_ptr<Directory> Archive_SDMC::OpenDirectory(const Path& path) const {+std::unique_ptr<DirectoryBackend> Archive_SDMC::OpenDirectory(const Path& path) const {LOG_DEBUG(Service_FS, "called path=%s", path.DebugStr().c_str());Directory_SDMC* directory = new Directory_SDMC(this, path);if (!directory->Open())return nullptr;- return std::unique_ptr<Directory>(directory);+ return std::unique_ptr<DirectoryBackend>(directory);}/**diff --git a/src/core/file_sys/archive_sdmc.h b/src/core/file_sys/archive_sdmc.hindex 347f3945eb..f4cb96159c 100644--- a/src/core/file_sys/archive_sdmc.h+++ b/src/core/file_sys/archive_sdmc.h@@ -78,7 +78,7 @@ public:* @param path Path relative to the archive* @return Opened directory, or nullptr*/- std::unique_ptr<Directory> OpenDirectory(const Path& path) const override;+ std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const override;/*** Read data from the archivediff --git a/src/core/file_sys/directory.h b/src/core/file_sys/directory_backend.hsimilarity index 95%rename from src/core/file_sys/directory.hrename to src/core/file_sys/directory_backend.hindex 1bb4101d6d..188746a6fa 100644--- a/src/core/file_sys/directory.h+++ b/src/core/file_sys/directory_backend.h@@ -36,10 +36,10 @@ static_assert(offsetof(Entry, extension) == 0x216, "Wrong offset for extension istatic_assert(offsetof(Entry, is_archive) == 0x21E, "Wrong offset for is_archive in Entry.");static_assert(offsetof(Entry, file_size) == 0x220, "Wrong offset for file_size in Entry.");-class Directory : NonCopyable {+class DirectoryBackend : NonCopyable {public:- Directory() { }- virtual ~Directory() { }+ DirectoryBackend() { }+ virtual ~DirectoryBackend() { }/*** Open the directorydiff --git a/src/core/file_sys/directory_romfs.h b/src/core/file_sys/directory_romfs.hindex e2944099e1..b775f014d5 100644--- a/src/core/file_sys/directory_romfs.h+++ b/src/core/file_sys/directory_romfs.h@@ -6,7 +6,7 @@#include "common/common_types.h"-#include "core/file_sys/directory.h"+#include "core/file_sys/directory_backend.h"#include "core/loader/loader.h"////////////////////////////////////////////////////////////////////////////////////////////////////@@ -14,7 +14,7 @@namespace FileSys {-class Directory_RomFS final : public Directory {+class Directory_RomFS final : public DirectoryBackend {public:Directory_RomFS();~Directory_RomFS() override;diff --git a/src/core/file_sys/directory_sdmc.h b/src/core/file_sys/directory_sdmc.hindex 4c08b0d61f..407a256ef0 100644--- a/src/core/file_sys/directory_sdmc.h+++ b/src/core/file_sys/directory_sdmc.h@@ -7,7 +7,7 @@#include "common/common_types.h"#include "common/file_util.h"-#include "core/file_sys/directory.h"+#include "core/file_sys/directory_backend.h"#include "core/file_sys/archive_sdmc.h"#include "core/loader/loader.h"@@ -16,7 +16,7 @@namespace FileSys {-class Directory_SDMC final : public Directory {+class Directory_SDMC final : public DirectoryBackend {public:Directory_SDMC();Directory_SDMC(const Archive_SDMC* archive, const Path& path);diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cppindex 6ec310a639..9a37251387 100644--- a/src/core/hle/service/fs/archive.cpp+++ b/src/core/hle/service/fs/archive.cpp@@ -10,7 +10,7 @@#include "core/file_sys/archive_backend.h"#include "core/file_sys/archive_sdmc.h"-#include "core/file_sys/directory.h"+#include "core/file_sys/directory_backend.h"#include "core/hle/service/fs/archive.h"#include "core/hle/kernel/session.h"#include "core/hle/result.h"@@ -186,7 +186,7 @@ public:std::string GetName() const override { return "Directory: " + path.DebugStr(); }FileSys::Path path; ///< Path of the directory- std::unique_ptr<FileSys::Directory> backend; ///< File backend interface+ std::unique_ptr<FileSys::DirectoryBackend> backend; ///< File backend interfaceResultVal<bool> SyncRequest() override {u32* cmd_buff = Kernel::GetCommandBuffer();