mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-21 21:05:50 +12:00
[FS] Archive::OpenArchive returns Result<T, E> now
This commit is contained in:
parent
37fb660c7f
commit
0b0d6dcf4b
12 changed files with 25 additions and 24 deletions
|
@ -40,13 +40,13 @@ FileDescriptor SelfNCCHArchive::openFile(const FSPath& path, const FilePerms& pe
|
|||
return NoFile; // No file descriptor needed for RomFS
|
||||
}
|
||||
|
||||
ArchiveBase* SelfNCCHArchive::openArchive(const FSPath& path) {
|
||||
Rust::Result<ArchiveBase*, FSResult> SelfNCCHArchive::openArchive(const FSPath& path) {
|
||||
if (path.type != PathType::Empty) {
|
||||
printf("Invalid path type for SelfNCCH archive: %d\n", path.type);
|
||||
return nullptr;
|
||||
Helpers::panic("Invalid path type for SelfNCCH archive: %d\n", path.type);
|
||||
return Err(FSResult::NotFoundInvalid);
|
||||
}
|
||||
|
||||
return this;
|
||||
return Ok((ArchiveBase*)this);
|
||||
}
|
||||
|
||||
std::optional<u32> SelfNCCHArchive::readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue