diff options
author | bunnei <bunneidev@gmail.com> | 2014-11-02 23:15:52 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-11-02 23:15:52 +0100 |
commit | 9be17e4d8420fecd42f61c9c26c1f31a3fad0d9d (patch) | |
tree | 8904eaeb0422ef0e85ecd4c077874d9f0a63a9cc /src/core/hle/kernel | |
parent | Merge pull request #179 from Gareth422/myradicalbranch (diff) | |
parent | Added CreateDirectory function to service/fs.cpp, and in Archive. (diff) | |
download | yuzu-9be17e4d8420fecd42f61c9c26c1f31a3fad0d9d.tar yuzu-9be17e4d8420fecd42f61c9c26c1f31a3fad0d9d.tar.gz yuzu-9be17e4d8420fecd42f61c9c26c1f31a3fad0d9d.tar.bz2 yuzu-9be17e4d8420fecd42f61c9c26c1f31a3fad0d9d.tar.lz yuzu-9be17e4d8420fecd42f61c9c26c1f31a3fad0d9d.tar.xz yuzu-9be17e4d8420fecd42f61c9c26c1f31a3fad0d9d.tar.zst yuzu-9be17e4d8420fecd42f61c9c26c1f31a3fad0d9d.zip |
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 } /** + * Create a Directory from an Archive + * @param archive_handle Handle to an open Archive object + * @param path Path to the Directory inside of the Archive + * @return Opened Directory object + */ +Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& path) { + Archive* archive = Kernel::g_object_pool.GetFast<Archive>(archive_handle); + if (archive == nullptr) + return -1; + if (archive->backend->CreateDirectory(path)) + return 0; + 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 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); * @param mode Mode under which to open the File * @return Opened File object */ -Handle OpenFileFromArchive(Handle handle, const std::string& name, const FileSys::Mode mode); +Handle OpenFileFromArchive(Handle archive_handle, const std::string& name, const FileSys::Mode mode); + +/** + * Create a Directory from an Archive + * @param archive_handle Handle to an open Archive object + * @param path Path to the Directory inside of the Archive + * @return Whether creation of directory succeeded + */ +Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& name); /** * Open a Directory from an Archive @@ -51,7 +59,7 @@ Handle OpenFileFromArchive(Handle handle, const std::string& name, const FileSys * @param path Path to the Directory inside of the Archive * @return Opened Directory object */ -Handle OpenDirectoryFromArchive(Handle handle, const std::string& name); +Handle OpenDirectoryFromArchive(Handle archive_handle, const std::string& name); /// Initialize archives void ArchiveInit(); |