summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar archshift2014-10-28 22:52:56 -0700
committerGravatar archshift2014-11-02 10:48:28 -0800
commit04c90c395d27e6bc205fb2d933ced50e70c1841a (patch)
tree18f5e206016e383ad07493e3ad5ba1279301e6a8 /src/core/file_sys
parentMerge pull request #178 from archshift/errf (diff)
downloadyuzu-04c90c395d27e6bc205fb2d933ced50e70c1841a.tar.gz
yuzu-04c90c395d27e6bc205fb2d933ced50e70c1841a.tar.xz
yuzu-04c90c395d27e6bc205fb2d933ced50e70c1841a.zip
Added CreateDirectory function to service/fs.cpp, and in Archive.
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/archive.h7
-rw-r--r--src/core/file_sys/archive_romfs.cpp10
-rw-r--r--src/core/file_sys/archive_romfs.h7
-rw-r--r--src/core/file_sys/archive_sdmc.cpp9
-rw-r--r--src/core/file_sys/archive_sdmc.h7
5 files changed, 40 insertions, 0 deletions
diff --git a/src/core/file_sys/archive.h b/src/core/file_sys/archive.h
index 560db6dea..aeabf09ac 100644
--- a/src/core/file_sys/archive.h
+++ b/src/core/file_sys/archive.h
@@ -57,6 +57,13 @@ public:
57 virtual std::unique_ptr<File> OpenFile(const std::string& path, const Mode mode) const = 0; 57 virtual std::unique_ptr<File> OpenFile(const std::string& path, const Mode mode) const = 0;
58 58
59 /** 59 /**
60 * Create a directory specified by its path
61 * @param path Path relative to the archive
62 * @return Whether the directory could be created
63 */
64 virtual bool CreateDirectory(const std::string& path) const = 0;
65
66 /**
60 * Open a directory specified by its path 67 * Open a directory specified by its path
61 * @param path Path relative to the archive 68 * @param path Path relative to the archive
62 * @return Opened directory, or nullptr 69 * @return Opened directory, or nullptr
diff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cpp
index f101fc729..cc759faa8 100644
--- a/src/core/file_sys/archive_romfs.cpp
+++ b/src/core/file_sys/archive_romfs.cpp
@@ -34,6 +34,16 @@ std::unique_ptr<File> Archive_RomFS::OpenFile(const std::string& path, const Mod
34} 34}
35 35
36/** 36/**
37 * Create a directory specified by its path
38 * @param path Path relative to the archive
39 * @return Whether the directory could be created
40 */
41bool Archive_RomFS::CreateDirectory(const std::string& path) const {
42 ERROR_LOG(FILESYS, "Attempted to create a directory in ROMFS.");
43 return false;
44};
45
46/**
37 * Open a directory specified by its path 47 * Open a directory specified by its path
38 * @param path Path relative to the archive 48 * @param path Path relative to the archive
39 * @return Opened directory, or nullptr 49 * @return Opened directory, or nullptr
diff --git a/src/core/file_sys/archive_romfs.h b/src/core/file_sys/archive_romfs.h
index fcdefa95f..ae2344e82 100644
--- a/src/core/file_sys/archive_romfs.h
+++ b/src/core/file_sys/archive_romfs.h
@@ -37,6 +37,13 @@ public:
37 std::unique_ptr<File> OpenFile(const std::string& path, const Mode mode) const override; 37 std::unique_ptr<File> OpenFile(const std::string& path, const Mode mode) const override;
38 38
39 /** 39 /**
40 * Create a directory specified by its path
41 * @param path Path relative to the archive
42 * @return Whether the directory could be created
43 */
44 bool CreateDirectory(const std::string& path) const override;
45
46 /**
40 * Open a directory specified by its path 47 * Open a directory specified by its path
41 * @param path Path relative to the archive 48 * @param path Path relative to the archive
42 * @return Opened directory, or nullptr 49 * @return Opened directory, or nullptr
diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp
index 0b647f7d0..66931e93e 100644
--- a/src/core/file_sys/archive_sdmc.cpp
+++ b/src/core/file_sys/archive_sdmc.cpp
@@ -58,6 +58,15 @@ std::unique_ptr<File> Archive_SDMC::OpenFile(const std::string& path, const Mode
58} 58}
59 59
60/** 60/**
61 * Create a directory specified by its path
62 * @param path Path relative to the archive
63 * @return Whether the directory could be created
64 */
65bool Archive_SDMC::CreateDirectory(const std::string& path) const {
66 return FileUtil::CreateDir(GetMountPoint() + path);
67}
68
69/**
61 * Open a directory specified by its path 70 * Open a directory specified by its path
62 * @param path Path relative to the archive 71 * @param path Path relative to the archive
63 * @return Opened directory, or nullptr 72 * @return Opened directory, or nullptr
diff --git a/src/core/file_sys/archive_sdmc.h b/src/core/file_sys/archive_sdmc.h
index f68648e6f..0e059b635 100644
--- a/src/core/file_sys/archive_sdmc.h
+++ b/src/core/file_sys/archive_sdmc.h
@@ -41,6 +41,13 @@ public:
41 std::unique_ptr<File> OpenFile(const std::string& path, const Mode mode) const override; 41 std::unique_ptr<File> OpenFile(const std::string& path, const Mode mode) const override;
42 42
43 /** 43 /**
44 * Create a directory specified by its path
45 * @param path Path relative to the archive
46 * @return Whether the directory could be created
47 */
48 bool CreateDirectory(const std::string& path) const override;
49
50 /**
44 * Open a directory specified by its path 51 * Open a directory specified by its path
45 * @param path Path relative to the archive 52 * @param path Path relative to the archive
46 * @return Opened directory, or nullptr 53 * @return Opened directory, or nullptr