summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/filesystem/fsp/fs_i_filesystem.h')
-rw-r--r--src/core/hle/service/filesystem/fsp/fs_i_filesystem.h80
1 files changed, 62 insertions, 18 deletions
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h
index d500be725..d07b74938 100644
--- a/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h
+++ b/src/core/hle/service/filesystem/fsp/fs_i_filesystem.h
@@ -5,35 +5,79 @@
#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_util.h"
#include "core/hle/service/service.h"
+namespace FileSys::Sf {
+struct Path;
+}
+
namespace Service::FileSystem {
+class IFile;
+class IDirectory;
+
class IFileSystem final : public ServiceFramework<IFileSystem> {
public:
- explicit IFileSystem(Core::System& system_, FileSys::VirtualDir dir_, SizeGetter size_);
-
- void CreateFile(HLERequestContext& ctx);
- void DeleteFile(HLERequestContext& ctx);
- void CreateDirectory(HLERequestContext& ctx);
- void DeleteDirectory(HLERequestContext& ctx);
- void DeleteDirectoryRecursively(HLERequestContext& ctx);
- void CleanDirectoryRecursively(HLERequestContext& ctx);
- void RenameFile(HLERequestContext& ctx);
- void OpenFile(HLERequestContext& ctx);
- void OpenDirectory(HLERequestContext& ctx);
- void GetEntryType(HLERequestContext& ctx);
- void Commit(HLERequestContext& ctx);
- void GetFreeSpaceSize(HLERequestContext& ctx);
- void GetTotalSpaceSize(HLERequestContext& ctx);
- void GetFileTimeStampRaw(HLERequestContext& ctx);
- void GetFileSystemAttribute(HLERequestContext& ctx);
+ explicit IFileSystem(Core::System& system_, FileSys::VirtualDir dir_, SizeGetter size_getter_);
+
+ struct FileSystemAttribute {
+ u8 dir_entry_name_length_max_defined;
+ u8 file_entry_name_length_max_defined;
+ u8 dir_path_name_length_max_defined;
+ u8 file_path_name_length_max_defined;
+ INSERT_PADDING_BYTES_NOINIT(0x5);
+ u8 utf16_dir_entry_name_length_max_defined;
+ u8 utf16_file_entry_name_length_max_defined;
+ u8 utf16_dir_path_name_length_max_defined;
+ u8 utf16_file_path_name_length_max_defined;
+ INSERT_PADDING_BYTES_NOINIT(0x18);
+ s32 dir_entry_name_length_max;
+ s32 file_entry_name_length_max;
+ s32 dir_path_name_length_max;
+ s32 file_path_name_length_max;
+ INSERT_PADDING_WORDS_NOINIT(0x5);
+ s32 utf16_dir_entry_name_length_max;
+ s32 utf16_file_entry_name_length_max;
+ s32 utf16_dir_path_name_length_max;
+ s32 utf16_file_path_name_length_max;
+ INSERT_PADDING_WORDS_NOINIT(0x18);
+ INSERT_PADDING_WORDS_NOINIT(0x1);
+ };
+ static_assert(sizeof(FileSystemAttribute) == 0xC0, "FileSystemAttribute has incorrect size");
+
+ Result CreateFile(const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path,
+ s32 option, s64 size);
+ Result DeleteFile(const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
+ Result CreateDirectory(const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
+ Result DeleteDirectory(const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
+ Result DeleteDirectoryRecursively(
+ const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
+ Result CleanDirectoryRecursively(
+ const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
+ Result RenameFile(const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> old_path,
+ const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> new_path);
+ Result OpenFile(OutInterface<IFile> out_interface,
+ const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path, u32 mode);
+ Result OpenDirectory(OutInterface<IDirectory> out_interface,
+ const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path,
+ u32 mode);
+ Result GetEntryType(Out<u32> out_type,
+ const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
+ Result Commit();
+ Result GetFreeSpaceSize(Out<s64> out_size,
+ const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
+ Result GetTotalSpaceSize(Out<s64> out_size,
+ const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
+ Result GetFileTimeStampRaw(Out<FileSys::FileTimeStampRaw> out_timestamp,
+ const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
+ Result GetFileSystemAttribute(Out<FileSystemAttribute> out_attribute);
private:
std::unique_ptr<FileSys::Fsa::IFileSystem> backend;
- SizeGetter size;
+ SizeGetter size_getter;
};
} // namespace Service::FileSystem