summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-10-29 06:52:56 +0100
committerarchshift <admin@archshift.com>2014-11-02 19:48:28 +0100
commit04c90c395d27e6bc205fb2d933ced50e70c1841a (patch)
tree18f5e206016e383ad07493e3ad5ba1279301e6a8 /src/core/hle/kernel
parentMerge pull request #178 from archshift/errf (diff)
downloadyuzu-04c90c395d27e6bc205fb2d933ced50e70c1841a.tar
yuzu-04c90c395d27e6bc205fb2d933ced50e70c1841a.tar.gz
yuzu-04c90c395d27e6bc205fb2d933ced50e70c1841a.tar.bz2
yuzu-04c90c395d27e6bc205fb2d933ced50e70c1841a.tar.lz
yuzu-04c90c395d27e6bc205fb2d933ced50e70c1841a.tar.xz
yuzu-04c90c395d27e6bc205fb2d933ced50e70c1841a.tar.zst
yuzu-04c90c395d27e6bc205fb2d933ced50e70c1841a.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/archive.cpp15
-rw-r--r--src/core/hle/kernel/archive.h12
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();