aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/filesystem/filesystem.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-03-04 15:49:42 -0500
committerGitHub <noreply@github.com>2018-03-04 15:49:42 -0500
commit80562aaf64413f5740138dba70393789d10de580 (patch)
tree01b8f6a28202295b25eaa90e8cbbef5a9b3c0c6f /src/core/hle/service/filesystem/filesystem.cpp
parent3c3d5eeddf34bc52b2770df8f1c4cda1dc8e5b77 (diff)
parent84e1c0a43016e4c0e99aa50b1486af53b7d05513 (diff)
Merge pull request #229 from Subv/ensuresavedata_impl
FS: Make EnsureSaveData create the save data if it doesn't already exist.
Diffstat (limited to 'src/core/hle/service/filesystem/filesystem.cpp')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 32752aea5..ef05955b9 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -43,6 +43,19 @@ ResultVal<std::unique_ptr<FileSys::FileSystemBackend>> OpenFileSystem(Type type,
return itr->second->Open(path);
}
+ResultCode FormatFileSystem(Type type) {
+ LOG_TRACE(Service_FS, "Formatting FileSystem with type=%d", type);
+
+ auto itr = filesystem_map.find(type);
+ if (itr == filesystem_map.end()) {
+ // TODO(bunnei): Find a better error code for this
+ return ResultCode(-1);
+ }
+
+ FileSys::Path unused;
+ return itr->second->Format(unused);
+}
+
void RegisterFileSystems() {
filesystem_map.clear();