diff options
| author | 2014-11-24 01:12:58 -0800 | |
|---|---|---|
| committer | 2014-11-24 15:09:12 -0800 | |
| commit | e5ff01c2cde0fe903140f0215461a68d4f489132 (patch) | |
| tree | 1ce6d82dcc1d154a98d5931d57c30e12ef0cc18f /src/core/hle/kernel/archive.cpp | |
| parent | Implemented RenameFile in FS:USER (diff) | |
| download | yuzu-e5ff01c2cde0fe903140f0215461a68d4f489132.tar.gz yuzu-e5ff01c2cde0fe903140f0215461a68d4f489132.tar.xz yuzu-e5ff01c2cde0fe903140f0215461a68d4f489132.zip | |
Implemented RenameDirectory in FS:USER
Diffstat (limited to 'src/core/hle/kernel/archive.cpp')
| -rw-r--r-- | src/core/hle/kernel/archive.cpp | 24 |
1 files changed, 24 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 |