summaryrefslogtreecommitdiff
path: root/src/core/file_sys/vfs.h
diff options
context:
space:
mode:
authorGravatar Lioncash2018-11-30 14:44:13 -0500
committerGravatar Lioncash2018-11-30 20:17:28 -0500
commita7d9fe993a3e0e4d939752d2e447cc2b5fdb80f0 (patch)
treef5932b1a6b6451c41565b9b5a74dfff4f44fb6f0 /src/core/file_sys/vfs.h
parentMerge pull request #1829 from lioncash/lang (diff)
downloadyuzu-a7d9fe993a3e0e4d939752d2e447cc2b5fdb80f0.tar.gz
yuzu-a7d9fe993a3e0e4d939752d2e447cc2b5fdb80f0.tar.xz
yuzu-a7d9fe993a3e0e4d939752d2e447cc2b5fdb80f0.zip
service/fsp_srv: Implement CleanDirectoryRecursively
This is the same behavior-wise as DeleteDirectoryRecursively, with the only difference being that it doesn't delete the top level directory in the hierarchy, so given: root_dir/ - some_dir/ - File.txt - OtherFile.txt The end result is just: root_dir/
Diffstat (limited to 'src/core/file_sys/vfs.h')
-rw-r--r--src/core/file_sys/vfs.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/core/file_sys/vfs.h b/src/core/file_sys/vfs.h
index 002f99d4e..6e1db36f1 100644
--- a/src/core/file_sys/vfs.h
+++ b/src/core/file_sys/vfs.h
@@ -245,12 +245,18 @@ public:
245 // any failure. 245 // any failure.
246 virtual std::shared_ptr<VfsDirectory> CreateDirectoryAbsolute(std::string_view path); 246 virtual std::shared_ptr<VfsDirectory> CreateDirectoryAbsolute(std::string_view path);
247 247
248 // Deletes the subdirectory with name and returns true on success. 248 // Deletes the subdirectory with the given name and returns true on success.
249 virtual bool DeleteSubdirectory(std::string_view name) = 0; 249 virtual bool DeleteSubdirectory(std::string_view name) = 0;
250 // Deletes all subdirectories and files of subdirectory with name recirsively and then deletes 250
251 // the subdirectory. Returns true on success. 251 // Deletes all subdirectories and files within the provided directory and then deletes
252 // the directory itself. Returns true on success.
252 virtual bool DeleteSubdirectoryRecursive(std::string_view name); 253 virtual bool DeleteSubdirectoryRecursive(std::string_view name);
253 // Returnes whether or not the file with name name was deleted successfully. 254
255 // Deletes all subdirectories and files within the provided directory.
256 // Unlike DeleteSubdirectoryRecursive, this does not delete the provided directory.
257 virtual bool CleanSubdirectoryRecursive(std::string_view name);
258
259 // Returns whether or not the file with name name was deleted successfully.
254 virtual bool DeleteFile(std::string_view name) = 0; 260 virtual bool DeleteFile(std::string_view name) = 0;
255 261
256 // Returns whether or not this directory was renamed to name. 262 // Returns whether or not this directory was renamed to name.
@@ -277,6 +283,7 @@ public:
277 std::shared_ptr<VfsDirectory> CreateSubdirectory(std::string_view name) override; 283 std::shared_ptr<VfsDirectory> CreateSubdirectory(std::string_view name) override;
278 std::shared_ptr<VfsFile> CreateFile(std::string_view name) override; 284 std::shared_ptr<VfsFile> CreateFile(std::string_view name) override;
279 bool DeleteSubdirectory(std::string_view name) override; 285 bool DeleteSubdirectory(std::string_view name) override;
286 bool CleanSubdirectoryRecursive(std::string_view name) override;
280 bool DeleteFile(std::string_view name) override; 287 bool DeleteFile(std::string_view name) override;
281 bool Rename(std::string_view name) override; 288 bool Rename(std::string_view name) override;
282}; 289};