diff options
author | FearlessTobi <thm.frey@gmail.com> | 2024-01-05 05:23:58 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-01-25 22:40:42 +0100 |
commit | 06fb7f90da0b465e723a562134c12b513aa77dff (patch) | |
tree | a256bbe22aa4c2a6704f41eb22b3d2cfba0fed72 /src/core/hle/service/filesystem/fsp/fsp_util.h | |
parent | Merge pull request #12759 from liamwhite/mp-misc (diff) | |
download | yuzu-06fb7f90da0b465e723a562134c12b513aa77dff.tar yuzu-06fb7f90da0b465e723a562134c12b513aa77dff.tar.gz yuzu-06fb7f90da0b465e723a562134c12b513aa77dff.tar.bz2 yuzu-06fb7f90da0b465e723a562134c12b513aa77dff.tar.lz yuzu-06fb7f90da0b465e723a562134c12b513aa77dff.tar.xz yuzu-06fb7f90da0b465e723a562134c12b513aa77dff.tar.zst yuzu-06fb7f90da0b465e723a562134c12b513aa77dff.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/filesystem/fsp/fsp_util.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/hle/service/filesystem/fsp/fsp_util.h b/src/core/hle/service/filesystem/fsp/fsp_util.h new file mode 100644 index 000000000..253f866db --- /dev/null +++ b/src/core/hle/service/filesystem/fsp/fsp_util.h @@ -0,0 +1,22 @@ +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/filesystem/filesystem.h" + +namespace Service::FileSystem { + +struct SizeGetter { + std::function<u64()> get_free_size; + std::function<u64()> get_total_size; + + static SizeGetter FromStorageId(const FileSystemController& fsc, FileSys::StorageId id) { + return { + [&fsc, id] { return fsc.GetFreeSpaceSize(id); }, + [&fsc, id] { return fsc.GetTotalSpaceSize(id); }, + }; + } +}; + +} // namespace Service::FileSystem |