summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-28 07:29:52 +0100
committerGitHub <noreply@github.com>2018-10-28 07:29:52 +0100
commit0d449b77e29cce33480f26ce235a8ce0a97202d7 (patch)
treed91b1cf552a67ddaa1d4a1e8075420ca07e0d973
parentMerge pull request #1600 from DarkLordZach/nsp-secondary-loader-fix (diff)
parentservice/filesystem: Add DirectoryDelete & DirectoryDeleteRecursively (diff)
downloadyuzu-0d449b77e29cce33480f26ce235a8ce0a97202d7.tar
yuzu-0d449b77e29cce33480f26ce235a8ce0a97202d7.tar.gz
yuzu-0d449b77e29cce33480f26ce235a8ce0a97202d7.tar.bz2
yuzu-0d449b77e29cce33480f26ce235a8ce0a97202d7.tar.lz
yuzu-0d449b77e29cce33480f26ce235a8ce0a97202d7.tar.xz
yuzu-0d449b77e29cce33480f26ce235a8ce0a97202d7.tar.zst
yuzu-0d449b77e29cce33480f26ce235a8ce0a97202d7.zip
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index c87721c39..c1c83a11d 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -273,8 +273,8 @@ public:
{0, &IFileSystem::CreateFile, "CreateFile"},
{1, &IFileSystem::DeleteFile, "DeleteFile"},
{2, &IFileSystem::CreateDirectory, "CreateDirectory"},
- {3, nullptr, "DeleteDirectory"},
- {4, nullptr, "DeleteDirectoryRecursively"},
+ {3, &IFileSystem::DeleteDirectory, "DeleteDirectory"},
+ {4, &IFileSystem::DeleteDirectoryRecursively, "DeleteDirectoryRecursively"},
{5, &IFileSystem::RenameFile, "RenameFile"},
{6, nullptr, "RenameDirectory"},
{7, &IFileSystem::GetEntryType, "GetEntryType"},
@@ -329,6 +329,30 @@ public:
rb.Push(backend.CreateDirectory(name));
}
+ void DeleteDirectory(Kernel::HLERequestContext& ctx) {
+ const IPC::RequestParser rp{ctx};
+
+ const auto file_buffer = ctx.ReadBuffer();
+ std::string name = Common::StringFromBuffer(file_buffer);
+
+ LOG_DEBUG(Service_FS, "called directory {}", name);
+
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(backend.DeleteDirectory(name));
+ }
+
+ void DeleteDirectoryRecursively(Kernel::HLERequestContext& ctx) {
+ const IPC::RequestParser rp{ctx};
+
+ const auto file_buffer = ctx.ReadBuffer();
+ std::string name = Common::StringFromBuffer(file_buffer);
+
+ LOG_DEBUG(Service_FS, "called directory {}", name);
+
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(backend.DeleteDirectoryRecursively(name));
+ }
+
void RenameFile(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};