From 4dd8a831bd5ea32108db837754289ab42a2fa6ca Mon Sep 17 00:00:00 2001 From: wwylele Date: Fri, 14 Oct 2016 15:29:09 +0800 Subject: FileSys: make Archive interfaces return error code and make the mode parameter a reference since it is a BitField union --- src/core/file_sys/ivfc_archive.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/core/file_sys/ivfc_archive.h') diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index 2fbb3a568..af6297e1f 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h @@ -33,15 +33,15 @@ public: std::string GetName() const override; ResultVal> OpenFile(const Path& path, - const Mode mode) const override; + const Mode& mode) const override; ResultCode DeleteFile(const Path& path) const override; - bool RenameFile(const Path& src_path, const Path& dest_path) const override; - bool DeleteDirectory(const Path& path) const override; - bool DeleteDirectoryRecursively(const Path& path) const override; + ResultCode RenameFile(const Path& src_path, const Path& dest_path) const override; + ResultCode DeleteDirectory(const Path& path) const override; + ResultCode DeleteDirectoryRecursively(const Path& path) const override; ResultCode CreateFile(const Path& path, u64 size) const override; - bool CreateDirectory(const Path& path) const override; - bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; - std::unique_ptr OpenDirectory(const Path& path) const override; + ResultCode CreateDirectory(const Path& path) const override; + ResultCode RenameDirectory(const Path& src_path, const Path& dest_path) const override; + ResultVal> OpenDirectory(const Path& path) const override; u64 GetFreeBytes() const override; protected: -- cgit v1.2.3 From 0e754875d175bfec393a3f4c4f6ad73f45ed361f Mon Sep 17 00:00:00 2001 From: wwylele Date: Sun, 16 Oct 2016 23:09:36 +0800 Subject: FileSys: remove Open from DirectoryBackend Open should not be an interface exposed by Directory because it is the Archive thats implement the methed to open the directory. The service API of 3DS also implies this - Open is not a function of directory service, but is of FS main service --- src/core/file_sys/ivfc_archive.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/core/file_sys/ivfc_archive.h') diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index af6297e1f..826261441 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h @@ -75,9 +75,6 @@ private: class IVFCDirectory : public DirectoryBackend { public: - bool Open() override { - return false; - } u32 Read(const u32 count, Entry* entries) override { return 0; } -- cgit v1.2.3 From 9a0405858a5602a5e1e112b131ecdd8ca27e6d10 Mon Sep 17 00:00:00 2001 From: wwylele Date: Mon, 17 Oct 2016 10:10:23 +0800 Subject: FileSys: remove Open from FileBackend Same as directory, file shouldn't expose Open either. --- src/core/file_sys/ivfc_archive.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/core/file_sys/ivfc_archive.h') diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index 826261441..e6fbdfb1f 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h @@ -55,9 +55,6 @@ public: IVFCFile(std::shared_ptr file, u64 offset, u64 size) : romfs_file(file), data_offset(offset), data_size(size) {} - ResultCode Open() override { - return RESULT_SUCCESS; - } ResultVal Read(u64 offset, size_t length, u8* buffer) const override; ResultVal Write(u64 offset, size_t length, bool flush, const u8* buffer) const override; u64 GetSize() const override; -- cgit v1.2.3