mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 20:49:12 +12:00
[FS] Done with CreateFile
This commit is contained in:
parent
93d2d300b9
commit
49dcc25795
15 changed files with 85 additions and 3 deletions
|
@ -105,6 +105,12 @@ struct ArchiveSession {
|
|||
// Otherwise the fd of the opened file is returned (or nullptr if the opened file doesn't require one)
|
||||
using FileDescriptor = std::optional<FILE*>;
|
||||
|
||||
enum class CreateFileResult : u32 {
|
||||
Success = 0,
|
||||
AlreadyExists = 0x82044BE,
|
||||
FileTooLarge = 0x86044D2
|
||||
};
|
||||
|
||||
class ArchiveBase {
|
||||
protected:
|
||||
using Handle = u32;
|
||||
|
@ -161,6 +167,7 @@ protected:
|
|||
public:
|
||||
virtual std::string name() = 0;
|
||||
virtual u64 getFreeBytes() = 0;
|
||||
virtual CreateFileResult createFile(const FSPath& path, u64 size) = 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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue