diff options
| author | 2018-03-21 09:36:26 -0500 | |
|---|---|---|
| committer | 2018-03-21 09:55:59 -0500 | |
| commit | eff3f60b73343365ad65638f55591965df6f7e25 (patch) | |
| tree | 9b2d61666ff0f516b06d3a6cfda144afb5fb72e7 /src/core/hle | |
| parent | FS: Implemented IFileSystem's OpenDirectory function. (diff) | |
| download | yuzu-eff3f60b73343365ad65638f55591965df6f7e25.tar.gz yuzu-eff3f60b73343365ad65638f55591965df6f7e25.tar.xz yuzu-eff3f60b73343365ad65638f55591965df6f7e25.zip | |
FS: Implemented IFileSystem::CreateDirectory.
Diffstat (limited to 'src/core/hle')
| -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: | |||
| 208 | : ServiceFramework("IFileSystem"), backend(std::move(backend)) { | 208 | : ServiceFramework("IFileSystem"), backend(std::move(backend)) { |
| 209 | static const FunctionInfo functions[] = { | 209 | static const FunctionInfo functions[] = { |
| 210 | {0, &IFileSystem::CreateFile, "CreateFile"}, | 210 | {0, &IFileSystem::CreateFile, "CreateFile"}, |
| 211 | {2, &IFileSystem::CreateDirectory, "CreateDirectory"}, | ||
| 211 | {7, &IFileSystem::GetEntryType, "GetEntryType"}, | 212 | {7, &IFileSystem::GetEntryType, "GetEntryType"}, |
| 212 | {8, &IFileSystem::OpenFile, "OpenFile"}, | 213 | {8, &IFileSystem::OpenFile, "OpenFile"}, |
| 213 | {9, &IFileSystem::OpenDirectory, "OpenDirectory"}, | 214 | {9, &IFileSystem::OpenDirectory, "OpenDirectory"}, |
| @@ -234,6 +235,20 @@ public: | |||
| 234 | rb.Push(backend->CreateFile(name, size)); | 235 | rb.Push(backend->CreateFile(name, size)); |
| 235 | } | 236 | } |
| 236 | 237 | ||
| 238 | void CreateDirectory(Kernel::HLERequestContext& ctx) { | ||
| 239 | IPC::RequestParser rp{ctx}; | ||
| 240 | |||
| 241 | auto file_buffer = ctx.ReadBuffer(); | ||
| 242 | auto end = std::find(file_buffer.begin(), file_buffer.end(), '\0'); | ||
| 243 | |||
| 244 | std::string name(file_buffer.begin(), end); | ||
| 245 | |||
| 246 | LOG_DEBUG(Service_FS, "called directory %s", name.c_str()); | ||
| 247 | |||
| 248 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 249 | rb.Push(backend->CreateDirectory(name)); | ||
| 250 | } | ||
| 251 | |||
| 237 | void OpenFile(Kernel::HLERequestContext& ctx) { | 252 | void OpenFile(Kernel::HLERequestContext& ctx) { |
| 238 | IPC::RequestParser rp{ctx}; | 253 | IPC::RequestParser rp{ctx}; |
| 239 | 254 | ||