mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-04 11:14:48 +12:00
[FS] Add DeleteFile
This commit is contained in:
parent
a1cb50925f
commit
687c99cab6
13 changed files with 84 additions and 6 deletions
|
@ -115,6 +115,11 @@ enum class CreateFileResult : u32 {
|
|||
FileTooLarge = 0x86044D2
|
||||
};
|
||||
|
||||
enum class DeleteFileResult : u32 {
|
||||
Success = 0,
|
||||
FileNotFound = 0xC8804470
|
||||
};
|
||||
|
||||
class ArchiveBase {
|
||||
protected:
|
||||
using Handle = u32;
|
||||
|
@ -172,6 +177,8 @@ public:
|
|||
virtual std::string name() = 0;
|
||||
virtual u64 getFreeBytes() = 0;
|
||||
virtual CreateFileResult createFile(const FSPath& path, u64 size) = 0;
|
||||
virtual DeleteFileResult deleteFile(const FSPath& path) = 0;
|
||||
|
||||
// Returns nullopt if opening the file failed, otherwise returns a file descriptor to it (nullptr if none is needed)
|
||||
virtual FileDescriptor openFile(const FSPath& path, const FilePerms& perms) = 0;
|
||||
|
||||
|
|
|
@ -8,8 +8,10 @@ public:
|
|||
u64 getFreeBytes() override { Helpers::panic("ExtSaveData::GetFreeBytes unimplemented"); return 0; }
|
||||
std::string name() override { return "ExtSaveData"; }
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
CreateFileResult createFile(const FSPath& path, u64 size) override;
|
||||
DeleteFileResult deleteFile(const FSPath& path) override;
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
|
||||
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override;
|
||||
|
||||
|
|
|
@ -8,8 +8,10 @@ public:
|
|||
u64 getFreeBytes() override { Helpers::panic("NCCH::GetFreeBytes unimplemented"); return 0; }
|
||||
std::string name() override { return "NCCH"; }
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
CreateFileResult createFile(const FSPath& path, u64 size) override;
|
||||
DeleteFileResult deleteFile(const FSPath& path) override;
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
|
||||
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override;
|
||||
|
||||
|
|
|
@ -8,8 +8,10 @@ public:
|
|||
u64 getFreeBytes() override { Helpers::panic("SaveData::GetFreeBytes unimplemented"); return 0; }
|
||||
std::string name() override { return "SaveData"; }
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
CreateFileResult createFile(const FSPath& path, u64 size) override;
|
||||
DeleteFileResult deleteFile(const FSPath& path) override;
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
|
||||
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override;
|
||||
|
||||
|
|
|
@ -8,8 +8,10 @@ public:
|
|||
u64 getFreeBytes() override { Helpers::panic("SDMC::GetFreeBytes unimplemented"); return 0; }
|
||||
std::string name() override { return "SDMC"; }
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
CreateFileResult createFile(const FSPath& path, u64 size) override;
|
||||
DeleteFileResult deleteFile(const FSPath& path) override;
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
|
||||
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override;
|
||||
};
|
|
@ -8,8 +8,10 @@ public:
|
|||
u64 getFreeBytes() override { return 0; }
|
||||
std::string name() override { return "SelfNCCH"; }
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
CreateFileResult createFile(const FSPath& path, u64 size) override;
|
||||
DeleteFileResult deleteFile(const FSPath& path) override;
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
|
||||
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue