diff options
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/archive.cpp | 15 | ||||
| -rw-r--r-- | src/core/hle/kernel/archive.h | 12 |
2 files changed, 25 insertions, 2 deletions
diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp index 4a6140c71..764082d71 100644 --- a/src/core/hle/kernel/archive.cpp +++ b/src/core/hle/kernel/archive.cpp | |||
| @@ -381,6 +381,21 @@ Handle OpenFileFromArchive(Handle archive_handle, const std::string& path, const | |||
| 381 | } | 381 | } |
| 382 | 382 | ||
| 383 | /** | 383 | /** |
| 384 | * Create a Directory from an Archive | ||
| 385 | * @param archive_handle Handle to an open Archive object | ||
| 386 | * @param path Path to the Directory inside of the Archive | ||
| 387 | * @return Opened Directory object | ||
| 388 | */ | ||
| 389 | Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& path) { | ||
| 390 | Archive* archive = Kernel::g_object_pool.GetFast<Archive>(archive_handle); | ||
| 391 | if (archive == nullptr) | ||
| 392 | return -1; | ||
| 393 | if (archive->backend->CreateDirectory(path)) | ||
| 394 | return 0; | ||
| 395 | return -1; | ||
| 396 | } | ||
| 397 | |||
| 398 | /** | ||
| 384 | * Open a Directory from an Archive | 399 | * Open a Directory from an Archive |
| 385 | * @param archive_handle Handle to an open Archive object | 400 | * @param archive_handle Handle to an open Archive object |
| 386 | * @param path Path to the Directory inside of the Archive | 401 | * @param path Path to the Directory inside of the Archive |
diff --git a/src/core/hle/kernel/archive.h b/src/core/hle/kernel/archive.h index 593861f8e..0230996b6 100644 --- a/src/core/hle/kernel/archive.h +++ b/src/core/hle/kernel/archive.h | |||
| @@ -43,7 +43,15 @@ Handle CreateArchive(FileSys::Archive* backend, const std::string& name); | |||
| 43 | * @param mode Mode under which to open the File | 43 | * @param mode Mode under which to open the File |
| 44 | * @return Opened File object | 44 | * @return Opened File object |
| 45 | */ | 45 | */ |
| 46 | Handle OpenFileFromArchive(Handle handle, const std::string& name, const FileSys::Mode mode); | 46 | Handle OpenFileFromArchive(Handle archive_handle, const std::string& name, const FileSys::Mode mode); |
| 47 | |||
| 48 | /** | ||
| 49 | * Create a Directory from an Archive | ||
| 50 | * @param archive_handle Handle to an open Archive object | ||
| 51 | * @param path Path to the Directory inside of the Archive | ||
| 52 | * @return Whether creation of directory succeeded | ||
| 53 | */ | ||
| 54 | Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& name); | ||
| 47 | 55 | ||
| 48 | /** | 56 | /** |
| 49 | * Open a Directory from an Archive | 57 | * Open a Directory from an Archive |
| @@ -51,7 +59,7 @@ Handle OpenFileFromArchive(Handle handle, const std::string& name, const FileSys | |||
| 51 | * @param path Path to the Directory inside of the Archive | 59 | * @param path Path to the Directory inside of the Archive |
| 52 | * @return Opened Directory object | 60 | * @return Opened Directory object |
| 53 | */ | 61 | */ |
| 54 | Handle OpenDirectoryFromArchive(Handle handle, const std::string& name); | 62 | Handle OpenDirectoryFromArchive(Handle archive_handle, const std::string& name); |
| 55 | 63 | ||
| 56 | /// Initialize archives | 64 | /// Initialize archives |
| 57 | void ArchiveInit(); | 65 | void ArchiveInit(); |