mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-13 22:54:24 -04:00
fusee_cpp: implement KIP selection
This commit is contained in:
parent
622650623c
commit
cefdda77e5
7 changed files with 614 additions and 11 deletions
|
@ -74,6 +74,19 @@ namespace ams::fs {
|
|||
DirectoryEntryType_File = 1,
|
||||
};
|
||||
|
||||
struct DirectoryEntry {
|
||||
u64 file_size;
|
||||
u16 file_date;
|
||||
u16 file_time;
|
||||
u8 file_attr;
|
||||
char altname[13];
|
||||
char file_name[0x100];
|
||||
};
|
||||
|
||||
constexpr ALWAYS_INLINE DirectoryEntryType GetEntryType(const DirectoryEntry &entry) {
|
||||
return (entry.file_attr & 0x10) ? DirectoryEntryType_Directory : DirectoryEntryType_File;
|
||||
}
|
||||
|
||||
struct FileHandle {
|
||||
void *_handle;
|
||||
};
|
||||
|
@ -94,6 +107,11 @@ namespace ams::fs {
|
|||
Result CreateDirectory(const char *path);
|
||||
Result OpenFile(FileHandle *out_file, const char *path, int mode);
|
||||
|
||||
Result OpenDirectory(DirectoryHandle *out_dir, const char *path);
|
||||
|
||||
Result ReadDirectory(s64 *out_count, DirectoryEntry *out_entries, DirectoryHandle handle, s64 max_entries);
|
||||
void CloseDirectory(DirectoryHandle handle);
|
||||
|
||||
Result ReadFile(FileHandle handle, s64 offset, void *buffer, size_t size, const fs::ReadOption &option);
|
||||
Result ReadFile(FileHandle handle, s64 offset, void *buffer, size_t size);
|
||||
Result ReadFile(size_t *out, FileHandle handle, s64 offset, void *buffer, size_t size, const fs::ReadOption &option);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue