diff options
author | Liam <byteslice@airmail.cc> | 2024-01-08 06:49:00 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-01-11 17:28:52 +0100 |
commit | aae9eea53208fc0924c90ebb1272fcfaa3f23e0c (patch) | |
tree | 050ccc76dd2fad3c3f81197aa6435674caeac86f /src/core/hle/service/filesystem/save_data_controller.h | |
parent | Merge pull request #12608 from szepeviktor/typos (diff) | |
download | yuzu-aae9eea53208fc0924c90ebb1272fcfaa3f23e0c.tar yuzu-aae9eea53208fc0924c90ebb1272fcfaa3f23e0c.tar.gz yuzu-aae9eea53208fc0924c90ebb1272fcfaa3f23e0c.tar.bz2 yuzu-aae9eea53208fc0924c90ebb1272fcfaa3f23e0c.tar.lz yuzu-aae9eea53208fc0924c90ebb1272fcfaa3f23e0c.tar.xz yuzu-aae9eea53208fc0924c90ebb1272fcfaa3f23e0c.tar.zst yuzu-aae9eea53208fc0924c90ebb1272fcfaa3f23e0c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/filesystem/save_data_controller.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/core/hle/service/filesystem/save_data_controller.h b/src/core/hle/service/filesystem/save_data_controller.h new file mode 100644 index 000000000..863188e4c --- /dev/null +++ b/src/core/hle/service/filesystem/save_data_controller.h @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/file_sys/nca_metadata.h" +#include "core/file_sys/savedata_factory.h" +#include "core/file_sys/vfs_types.h" + +namespace Service::FileSystem { + +class SaveDataController { +public: + explicit SaveDataController(Core::System& system, + std::shared_ptr<FileSys::SaveDataFactory> factory_); + ~SaveDataController(); + + Result CreateSaveData(FileSys::VirtualDir* out_save_data, FileSys::SaveDataSpaceId space, + const FileSys::SaveDataAttribute& attribute); + Result OpenSaveData(FileSys::VirtualDir* out_save_data, FileSys::SaveDataSpaceId space, + const FileSys::SaveDataAttribute& attribute); + Result OpenSaveDataSpace(FileSys::VirtualDir* out_save_data_space, + FileSys::SaveDataSpaceId space); + + FileSys::SaveDataSize ReadSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id); + void WriteSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id, + FileSys::SaveDataSize new_value); + void SetAutoCreate(bool state); + +private: + Core::System& system; + const std::shared_ptr<FileSys::SaveDataFactory> factory; +}; + +} // namespace Service::FileSystem |