diff options
author | Subv <subv2112@gmail.com> | 2018-03-21 15:36:26 +0100 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2018-03-21 15:55:59 +0100 |
commit | eff3f60b73343365ad65638f55591965df6f7e25 (patch) | |
tree | 9b2d61666ff0f516b06d3a6cfda144afb5fb72e7 /src/core/hle/service/filesystem/fsp_srv.cpp | |
parent | FS: Implemented IFileSystem's OpenDirectory function. (diff) | |
download | yuzu-eff3f60b73343365ad65638f55591965df6f7e25.tar yuzu-eff3f60b73343365ad65638f55591965df6f7e25.tar.gz yuzu-eff3f60b73343365ad65638f55591965df6f7e25.tar.bz2 yuzu-eff3f60b73343365ad65638f55591965df6f7e25.tar.lz yuzu-eff3f60b73343365ad65638f55591965df6f7e25.tar.xz yuzu-eff3f60b73343365ad65638f55591965df6f7e25.tar.zst yuzu-eff3f60b73343365ad65638f55591965df6f7e25.zip |
Diffstat (limited to 'src/core/hle/service/filesystem/fsp_srv.cpp')
-rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 6f539316e..cbb7552d9 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -208,6 +208,7 @@ public: : ServiceFramework("IFileSystem"), backend(std::move(backend)) { static const FunctionInfo functions[] = { {0, &IFileSystem::CreateFile, "CreateFile"}, + {2, &IFileSystem::CreateDirectory, "CreateDirectory"}, {7, &IFileSystem::GetEntryType, "GetEntryType"}, {8, &IFileSystem::OpenFile, "OpenFile"}, {9, &IFileSystem::OpenDirectory, "OpenDirectory"}, @@ -234,6 +235,20 @@ public: rb.Push(backend->CreateFile(name, size)); } + void CreateDirectory(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + + auto file_buffer = ctx.ReadBuffer(); + auto end = std::find(file_buffer.begin(), file_buffer.end(), '\0'); + + std::string name(file_buffer.begin(), end); + + LOG_DEBUG(Service_FS, "called directory %s", name.c_str()); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(backend->CreateDirectory(name)); + } + void OpenFile(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; |