diff options
author | Subv <subv2112@gmail.com> | 2018-03-04 19:03:58 +0100 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2018-03-04 20:30:07 +0100 |
commit | 0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902 (patch) | |
tree | d6fbf1e18b6b17fcb089306af26c48331100814c /src/core/hle/service/filesystem | |
parent | Merge pull request #226 from Subv/buffer_queue_event (diff) | |
download | yuzu-0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902.tar yuzu-0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902.tar.gz yuzu-0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902.tar.bz2 yuzu-0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902.tar.lz yuzu-0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902.tar.xz yuzu-0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902.tar.zst yuzu-0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 13 | ||||
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 7 |
2 files changed, 20 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(); diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 80f318676..8d30e94a1 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h @@ -44,6 +44,13 @@ ResultCode RegisterFileSystem(std::unique_ptr<FileSys::FileSystemFactory>&& fact ResultVal<std::unique_ptr<FileSys::FileSystemBackend>> OpenFileSystem(Type type, FileSys::Path& path); +/** + * Formats a file system + * @param type Type of the file system to format + * @return ResultCode of the operation + */ +ResultCode FormatFileSystem(Type type); + /// Registers all Filesystem services with the specified service manager. void InstallInterfaces(SM::ServiceManager& service_manager); |