diff options
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/archive.cpp | 24 | ||||
| -rw-r--r-- | src/core/hle/kernel/archive.h | 11 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp index 0bf31ea2f..bffe59952 100644 --- a/src/core/hle/kernel/archive.cpp +++ b/src/core/hle/kernel/archive.cpp | |||
| @@ -410,6 +410,30 @@ Result CreateDirectoryFromArchive(Handle archive_handle, const FileSys::Path& pa | |||
| 410 | } | 410 | } |
| 411 | 411 | ||
| 412 | /** | 412 | /** |
| 413 | * Rename a Directory between two Archives | ||
| 414 | * @param src_archive_handle Handle to the source Archive object | ||
| 415 | * @param src_path Path to the Directory inside of the source Archive | ||
| 416 | * @param dest_archive_handle Handle to the destination Archive object | ||
| 417 | * @param dest_path Path to the Directory inside of the destination Archive | ||
| 418 | * @return Whether rename succeeded | ||
| 419 | */ | ||
| 420 | Result RenameDirectoryBetweenArchives(Handle src_archive_handle, const FileSys::Path& src_path, | ||
| 421 | Handle dest_archive_handle, const FileSys::Path& dest_path) { | ||
| 422 | Archive* src_archive = Kernel::g_object_pool.GetFast<Archive>(src_archive_handle); | ||
| 423 | Archive* dest_archive = Kernel::g_object_pool.GetFast<Archive>(dest_archive_handle); | ||
| 424 | if (src_archive == nullptr || dest_archive == nullptr) | ||
| 425 | return -1; | ||
| 426 | if (src_archive == dest_archive) { | ||
| 427 | if (src_archive->backend->RenameDirectory(src_path, dest_path)) | ||
| 428 | return 0; | ||
| 429 | } else { | ||
| 430 | // TODO: Implement renaming across archives | ||
| 431 | return -1; | ||
| 432 | } | ||
| 433 | return -1; | ||
| 434 | } | ||
| 435 | |||
| 436 | /** | ||
| 413 | * Open a Directory from an Archive | 437 | * Open a Directory from an Archive |
| 414 | * @param archive_handle Handle to an open Archive object | 438 | * @param archive_handle Handle to an open Archive object |
| 415 | * @param path Path to the Directory inside of the Archive | 439 | * @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 5158fbae8..9d071d315 100644 --- a/src/core/hle/kernel/archive.h +++ b/src/core/hle/kernel/archive.h | |||
| @@ -80,6 +80,17 @@ Result DeleteDirectoryFromArchive(Handle archive_handle, const FileSys::Path& pa | |||
| 80 | Result CreateDirectoryFromArchive(Handle archive_handle, const FileSys::Path& path); | 80 | Result CreateDirectoryFromArchive(Handle archive_handle, const FileSys::Path& path); |
| 81 | 81 | ||
| 82 | /** | 82 | /** |
| 83 | * Rename a Directory between two Archives | ||
| 84 | * @param src_archive_handle Handle to the source Archive object | ||
| 85 | * @param src_path Path to the Directory inside of the source Archive | ||
| 86 | * @param dest_archive_handle Handle to the destination Archive object | ||
| 87 | * @param dest_path Path to the Directory inside of the destination Archive | ||
| 88 | * @return Whether rename succeeded | ||
| 89 | */ | ||
| 90 | Result RenameDirectoryBetweenArchives(Handle src_archive_handle, const FileSys::Path& src_path, | ||
| 91 | Handle dest_archive_handle, const FileSys::Path& dest_path); | ||
| 92 | |||
| 93 | /** | ||
| 83 | * Open a Directory from an Archive | 94 | * Open a Directory from an Archive |
| 84 | * @param archive_handle Handle to an open Archive object | 95 | * @param archive_handle Handle to an open Archive object |
| 85 | * @param path Path to the Directory inside of the Archive | 96 | * @param path Path to the Directory inside of the Archive |