summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/archive.cpp')
-rw-r--r--src/core/hle/kernel/archive.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp
index e273444c9..0bf31ea2f 100644
--- a/src/core/hle/kernel/archive.cpp
+++ b/src/core/hle/kernel/archive.cpp
@@ -356,6 +356,30 @@ Result DeleteFileFromArchive(Handle archive_handle, const FileSys::Path& path) {
356} 356}
357 357
358/** 358/**
359 * Rename a File between two Archives
360 * @param src_archive_handle Handle to the source Archive object
361 * @param src_path Path to the File inside of the source Archive
362 * @param dest_archive_handle Handle to the destination Archive object
363 * @param dest_path Path to the File inside of the destination Archive
364 * @return Whether rename succeeded
365 */
366Result RenameFileBetweenArchives(Handle src_archive_handle, const FileSys::Path& src_path,
367 Handle dest_archive_handle, const FileSys::Path& dest_path) {
368 Archive* src_archive = Kernel::g_object_pool.GetFast<Archive>(src_archive_handle);
369 Archive* dest_archive = Kernel::g_object_pool.GetFast<Archive>(dest_archive_handle);
370 if (src_archive == nullptr || dest_archive == nullptr)
371 return -1;
372 if (src_archive == dest_archive) {
373 if (src_archive->backend->RenameFile(src_path, dest_path))
374 return 0;
375 } else {
376 // TODO: Implement renaming across archives
377 return -1;
378 }
379 return -1;
380}
381
382/**
359 * Delete a Directory from an Archive 383 * Delete a Directory from an Archive
360 * @param archive_handle Handle to an open Archive object 384 * @param archive_handle Handle to an open Archive object
361 * @param path Path to the Directory inside of the Archive 385 * @param path Path to the Directory inside of the Archive