mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-07 12:44:49 +12:00
Refactor Rust::Result
into std::expected
The standard library already has support for this type as of C++23: https://en.cppreference.com/w/cpp/header/expected [This is also supported by all major compilers](https://en.cppreference.com/w/cpp/compiler_support#:~:text=Yes-,%3Cexpected%3E,-P0323R12%0AP2549R1)
This commit is contained in:
parent
57193e7944
commit
3d0a0ccc0b
21 changed files with 349 additions and 1621 deletions
|
@ -2,16 +2,19 @@
|
|||
#include "archive_base.hpp"
|
||||
|
||||
class NCCHArchive : public ArchiveBase {
|
||||
public:
|
||||
public:
|
||||
NCCHArchive(Memory& mem) : ArchiveBase(mem) {}
|
||||
|
||||
u64 getFreeBytes() override { Helpers::panic("NCCH::GetFreeBytes unimplemented"); return 0; }
|
||||
u64 getFreeBytes() override {
|
||||
Helpers::panic("NCCH::GetFreeBytes unimplemented");
|
||||
return 0;
|
||||
}
|
||||
std::string name() override { return "NCCH"; }
|
||||
|
||||
HorizonResult createFile(const FSPath& path, u64 size) override;
|
||||
HorizonResult deleteFile(const FSPath& path) override;
|
||||
|
||||
Rust::Result<ArchiveBase*, HorizonResult> openArchive(const FSPath& path) override;
|
||||
std::expected<ArchiveBase*, HorizonResult> 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