From 13efbdc2014177b84cae82e522b191e2f2f022df Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 31 Dec 2014 19:36:50 -0500 Subject: SaveDataCheck: Preliminary work in this archive. This allows Steel Diver to boot further, some files are needed. This is still not ready and needs a big cleanup, this will possibly be delayed until the way we handle archives is fixed (with factory classes instead of ahead-of-time creation of archives) --- src/core/file_sys/archive_romfs.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/core/file_sys/archive_romfs.h') diff --git a/src/core/file_sys/archive_romfs.h b/src/core/file_sys/archive_romfs.h index d4b1eb7f2..b657dd38b 100644 --- a/src/core/file_sys/archive_romfs.h +++ b/src/core/file_sys/archive_romfs.h @@ -20,6 +20,7 @@ namespace FileSys { class Archive_RomFS final : public ArchiveBackend { public: Archive_RomFS(const Loader::AppLoader& app_loader); + Archive_RomFS(std::string mount_point); std::string GetName() const override { return "RomFS"; } @@ -83,15 +84,13 @@ public: */ std::unique_ptr OpenDirectory(const Path& path) const override; - ResultCode Open(const Path& path) override { - return RESULT_SUCCESS; - } + ResultCode Open(const Path& path) override; ResultCode Format(const Path& path) const override; private: friend class File_RomFS; - + std::string mount_point; std::vector raw_data; }; -- cgit v1.2.3 From aade417b143a756da10b69747793c707ef8316fd Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 1 Jan 2015 12:39:27 -0500 Subject: Archives: Reduced duplicate code in RomFS and SaveCheck. Fixed a few warnings and cleaned up the code --- src/core/file_sys/archive_romfs.h | 75 ++------------------------------------- 1 file changed, 3 insertions(+), 72 deletions(-) (limited to 'src/core/file_sys/archive_romfs.h') diff --git a/src/core/file_sys/archive_romfs.h b/src/core/file_sys/archive_romfs.h index b657dd38b..5cb75e04d 100644 --- a/src/core/file_sys/archive_romfs.h +++ b/src/core/file_sys/archive_romfs.h @@ -8,7 +8,7 @@ #include "common/common_types.h" -#include "core/file_sys/archive_backend.h" +#include "core/file_sys/ivfc_archive.h" #include "core/loader/loader.h" //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -17,81 +17,12 @@ namespace FileSys { /// File system interface to the RomFS archive -class Archive_RomFS final : public ArchiveBackend { +class Archive_RomFS final : public IVFCArchive { public: Archive_RomFS(const Loader::AppLoader& app_loader); - Archive_RomFS(std::string mount_point); std::string GetName() const override { return "RomFS"; } - - /** - * Open a file specified by its path, using the specified mode - * @param path Path relative to the archive - * @param mode Mode to open the file with - * @return Opened file, or nullptr - */ - std::unique_ptr OpenFile(const Path& path, const Mode mode) const override; - - /** - * Delete a file specified by its path - * @param path Path relative to the archive - * @return Whether the file could be deleted - */ - bool DeleteFile(const Path& path) const override; - - /** - * Rename a File specified by its path - * @param src_path Source path relative to the archive - * @param dest_path Destination path relative to the archive - * @return Whether rename succeeded - */ - bool RenameFile(const Path& src_path, const Path& dest_path) const override; - - /** - * Delete a directory specified by its path - * @param path Path relative to the archive - * @return Whether the directory could be deleted - */ - bool DeleteDirectory(const Path& path) const override; - - /** - * Create a file specified by its path - * @param path Path relative to the Archive - * @param size The size of the new file, filled with zeroes - * @return File creation result code - */ - ResultCode CreateFile(const Path& path, u32 size) const override; - - /** - * Create a directory specified by its path - * @param path Path relative to the archive - * @return Whether the directory could be created - */ - bool CreateDirectory(const Path& path) const override; - - /** - * Rename a Directory specified by its path - * @param src_path Source path relative to the archive - * @param dest_path Destination path relative to the archive - * @return Whether rename succeeded - */ - bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; - - /** - * Open a directory specified by its path - * @param path Path relative to the archive - * @return Opened directory, or nullptr - */ - std::unique_ptr OpenDirectory(const Path& path) const override; - - ResultCode Open(const Path& path) override; - - ResultCode Format(const Path& path) const override; - -private: - friend class File_RomFS; - std::string mount_point; - std::vector raw_data; + ResultCode Open(const Path& path) override { return RESULT_SUCCESS; } }; } // namespace FileSys -- cgit v1.2.3