diff options
author | archshift <admin@archshift.com> | 2014-11-24 10:12:58 +0100 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-11-25 00:09:12 +0100 |
commit | e5ff01c2cde0fe903140f0215461a68d4f489132 (patch) | |
tree | 1ce6d82dcc1d154a98d5931d57c30e12ef0cc18f /src/core/hle/kernel/archive.cpp | |
parent | Implemented RenameFile in FS:USER (diff) | |
download | yuzu-e5ff01c2cde0fe903140f0215461a68d4f489132.tar yuzu-e5ff01c2cde0fe903140f0215461a68d4f489132.tar.gz yuzu-e5ff01c2cde0fe903140f0215461a68d4f489132.tar.bz2 yuzu-e5ff01c2cde0fe903140f0215461a68d4f489132.tar.lz yuzu-e5ff01c2cde0fe903140f0215461a68d4f489132.tar.xz yuzu-e5ff01c2cde0fe903140f0215461a68d4f489132.tar.zst yuzu-e5ff01c2cde0fe903140f0215461a68d4f489132.zip |
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 } /** + * Rename a Directory between two Archives + * @param src_archive_handle Handle to the source Archive object + * @param src_path Path to the Directory inside of the source Archive + * @param dest_archive_handle Handle to the destination Archive object + * @param dest_path Path to the Directory inside of the destination Archive + * @return Whether rename succeeded + */ +Result RenameDirectoryBetweenArchives(Handle src_archive_handle, const FileSys::Path& src_path, + Handle dest_archive_handle, const FileSys::Path& dest_path) { + Archive* src_archive = Kernel::g_object_pool.GetFast<Archive>(src_archive_handle); + Archive* dest_archive = Kernel::g_object_pool.GetFast<Archive>(dest_archive_handle); + if (src_archive == nullptr || dest_archive == nullptr) + return -1; + if (src_archive == dest_archive) { + if (src_archive->backend->RenameDirectory(src_path, dest_path)) + return 0; + } else { + // TODO: Implement renaming across archives + return -1; + } + return -1; +} + +/** * Open a Directory from an Archive * @param archive_handle Handle to an open Archive object * @param path Path to the Directory inside of the Archive |