// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include "common/common_funcs.h" #include "core/file_sys/fs_filesystem.h" #include "core/file_sys/fsa/fs_i_filesystem.h" #include "core/file_sys/vfs/vfs.h" #include "core/hle/service/cmif_types.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/filesystem/fsp/fsp_types.h" #include "core/hle/service/service.h" namespace FileSys::Sf { struct Path; } namespace Service::FileSystem { class IFile; class IDirectory; class IFileSystem final : public ServiceFramework { public: explicit IFileSystem(Core::System& system_, FileSys::VirtualDir dir_, SizeGetter size_getter_); Result CreateFile(const InLargeData path, s32 option, s64 size); Result DeleteFile(const InLargeData path); Result CreateDirectory(const InLargeData path); Result DeleteDirectory(const InLargeData path); Result DeleteDirectoryRecursively( const InLargeData path); Result CleanDirectoryRecursively( const InLargeData path); Result RenameFile(const InLargeData old_path, const InLargeData new_path); Result OpenFile(OutInterface out_interface, const InLargeData path, u32 mode); Result OpenDirectory(OutInterface out_interface, const InLargeData path, u32 mode); Result GetEntryType(Out out_type, const InLargeData path); Result Commit(); Result GetFreeSpaceSize(Out out_size, const InLargeData path); Result GetTotalSpaceSize(Out out_size, const InLargeData path); Result GetFileTimeStampRaw(Out out_timestamp, const InLargeData path); Result GetFileSystemAttribute(Out out_attribute); private: std::unique_ptr backend; SizeGetter size_getter; }; } // namespace Service::FileSystem