Merge pull request #1598 from DeeJayBro/delete-directory
service/filesystem: Implemented DeleteDirectory & DeleteDirectoryRecursive
This commit is contained in:
commit
0d449b77e2
|
@ -273,8 +273,8 @@ public:
|
||||||
{0, &IFileSystem::CreateFile, "CreateFile"},
|
{0, &IFileSystem::CreateFile, "CreateFile"},
|
||||||
{1, &IFileSystem::DeleteFile, "DeleteFile"},
|
{1, &IFileSystem::DeleteFile, "DeleteFile"},
|
||||||
{2, &IFileSystem::CreateDirectory, "CreateDirectory"},
|
{2, &IFileSystem::CreateDirectory, "CreateDirectory"},
|
||||||
{3, nullptr, "DeleteDirectory"},
|
{3, &IFileSystem::DeleteDirectory, "DeleteDirectory"},
|
||||||
{4, nullptr, "DeleteDirectoryRecursively"},
|
{4, &IFileSystem::DeleteDirectoryRecursively, "DeleteDirectoryRecursively"},
|
||||||
{5, &IFileSystem::RenameFile, "RenameFile"},
|
{5, &IFileSystem::RenameFile, "RenameFile"},
|
||||||
{6, nullptr, "RenameDirectory"},
|
{6, nullptr, "RenameDirectory"},
|
||||||
{7, &IFileSystem::GetEntryType, "GetEntryType"},
|
{7, &IFileSystem::GetEntryType, "GetEntryType"},
|
||||||
|
@ -329,6 +329,30 @@ public:
|
||||||
rb.Push(backend.CreateDirectory(name));
|
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) {
|
void RenameFile(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
|
|
||||||
|
|
Reference in New Issue