diff options
| author | 2016-10-02 11:29:04 +0800 | |
|---|---|---|
| committer | 2016-10-02 11:29:16 +0800 | |
| commit | 96b0e9476bdd010051bec427d365b49437801f4d (patch) | |
| tree | 6a80eef8c0fbbf7e891755a102fcc8674efb1f26 /src/core/file_sys | |
| parent | Merge pull request #2083 from yuriks/opengl-scissor-cached-rect (diff) | |
| download | yuzu-96b0e9476bdd010051bec427d365b49437801f4d.tar.gz yuzu-96b0e9476bdd010051bec427d365b49437801f4d.tar.xz yuzu-96b0e9476bdd010051bec427d365b49437801f4d.zip | |
fs: implement DeleteDirectoryRecursively
Diffstat (limited to 'src/core/file_sys')
| -rw-r--r-- | src/core/file_sys/archive_backend.h | 7 | ||||
| -rw-r--r-- | src/core/file_sys/disk_archive.cpp | 4 | ||||
| -rw-r--r-- | src/core/file_sys/disk_archive.h | 1 | ||||
| -rw-r--r-- | src/core/file_sys/ivfc_archive.cpp | 6 | ||||
| -rw-r--r-- | src/core/file_sys/ivfc_archive.h | 1 |
5 files changed, 19 insertions, 0 deletions
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index d69c3c785..06b8f2ed7 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h | |||
| @@ -112,6 +112,13 @@ public: | |||
| 112 | virtual bool DeleteDirectory(const Path& path) const = 0; | 112 | virtual bool DeleteDirectory(const Path& path) const = 0; |
| 113 | 113 | ||
| 114 | /** | 114 | /** |
| 115 | * Delete a directory specified by its path and anything under it | ||
| 116 | * @param path Path relative to the archive | ||
| 117 | * @return Whether the directory could be deleted | ||
| 118 | */ | ||
| 119 | virtual bool DeleteDirectoryRecursively(const Path& path) const = 0; | ||
| 120 | |||
| 121 | /** | ||
| 115 | * Create a file specified by its path | 122 | * Create a file specified by its path |
| 116 | * @param path Path relative to the Archive | 123 | * @param path Path relative to the Archive |
| 117 | * @param size The size of the new file, filled with zeroes | 124 | * @param size The size of the new file, filled with zeroes |
diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp index 0f66998e1..2f05af361 100644 --- a/src/core/file_sys/disk_archive.cpp +++ b/src/core/file_sys/disk_archive.cpp | |||
| @@ -51,6 +51,10 @@ bool DiskArchive::DeleteDirectory(const Path& path) const { | |||
| 51 | return FileUtil::DeleteDir(mount_point + path.AsString()); | 51 | return FileUtil::DeleteDir(mount_point + path.AsString()); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | bool DiskArchive::DeleteDirectoryRecursively(const Path& path) const { | ||
| 55 | return FileUtil::DeleteDirRecursively(mount_point + path.AsString()); | ||
| 56 | } | ||
| 57 | |||
| 54 | ResultCode DiskArchive::CreateFile(const FileSys::Path& path, u64 size) const { | 58 | ResultCode DiskArchive::CreateFile(const FileSys::Path& path, u64 size) const { |
| 55 | std::string full_path = mount_point + path.AsString(); | 59 | std::string full_path = mount_point + path.AsString(); |
| 56 | 60 | ||
diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index 2165f27f9..59ebb2002 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h | |||
| @@ -38,6 +38,7 @@ public: | |||
| 38 | ResultCode DeleteFile(const Path& path) const override; | 38 | ResultCode DeleteFile(const Path& path) const override; |
| 39 | bool RenameFile(const Path& src_path, const Path& dest_path) const override; | 39 | bool RenameFile(const Path& src_path, const Path& dest_path) const override; |
| 40 | bool DeleteDirectory(const Path& path) const override; | 40 | bool DeleteDirectory(const Path& path) const override; |
| 41 | bool DeleteDirectoryRecursively(const Path& path) const override; | ||
| 41 | ResultCode CreateFile(const Path& path, u64 size) const override; | 42 | ResultCode CreateFile(const Path& path, u64 size) const override; |
| 42 | bool CreateDirectory(const Path& path) const override; | 43 | bool CreateDirectory(const Path& path) const override; |
| 43 | bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; | 44 | bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; |
diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index 49cc1de10..af59d296d 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp | |||
| @@ -43,6 +43,12 @@ bool IVFCArchive::DeleteDirectory(const Path& path) const { | |||
| 43 | return false; | 43 | return false; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | bool IVFCArchive::DeleteDirectoryRecursively(const Path& path) const { | ||
| 47 | LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive (%s).", | ||
| 48 | GetName().c_str()); | ||
| 49 | return false; | ||
| 50 | } | ||
| 51 | |||
| 46 | ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const { | 52 | ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const { |
| 47 | LOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive (%s).", | 53 | LOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive (%s).", |
| 48 | GetName().c_str()); | 54 | GetName().c_str()); |
diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index 0df6cf83a..2fbb3a568 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h | |||
| @@ -37,6 +37,7 @@ public: | |||
| 37 | ResultCode DeleteFile(const Path& path) const override; | 37 | ResultCode DeleteFile(const Path& path) const override; |
| 38 | bool RenameFile(const Path& src_path, const Path& dest_path) const override; | 38 | bool RenameFile(const Path& src_path, const Path& dest_path) const override; |
| 39 | bool DeleteDirectory(const Path& path) const override; | 39 | bool DeleteDirectory(const Path& path) const override; |
| 40 | bool DeleteDirectoryRecursively(const Path& path) const override; | ||
| 40 | ResultCode CreateFile(const Path& path, u64 size) const override; | 41 | ResultCode CreateFile(const Path& path, u64 size) const override; |
| 41 | bool CreateDirectory(const Path& path) const override; | 42 | bool CreateDirectory(const Path& path) const override; |
| 42 | bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; | 43 | bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; |