[FS] Done with CreateFile

This commit is contained in:
wheremyfoodat 2023-01-23 02:35:10 +02:00
parent 93d2d300b9
commit 49dcc25795
15 changed files with 85 additions and 3 deletions

View file

@ -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;