mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-14 09:25:30 -04:00
Fileman default open and Screenshot viewer (#1102)
* WIP expensive way * Add default file handling to fileman * Remove screenshot_reader and tests * Read data in chunks * Format * Fix error text position * PR feedback --------- Co-authored-by: kallanreed <kallanreed@outlook.com>
This commit is contained in:
parent
f66f438487
commit
e5728b3501
8 changed files with 243 additions and 61 deletions
|
@ -85,9 +85,13 @@ File::Result<File::Size> File::write(const void* data, Size bytes_to_write) {
|
|||
}
|
||||
}
|
||||
|
||||
File::Offset File::tell() const {
|
||||
return f_tell(&f);
|
||||
}
|
||||
|
||||
File::Result<File::Offset> File::seek(Offset new_position) {
|
||||
/* NOTE: Returns *old* position, not new position */
|
||||
const auto old_position = f_tell(&f);
|
||||
const auto old_position = tell();
|
||||
const auto result = f_lseek(&f, new_position);
|
||||
if (result != FR_OK) {
|
||||
return {static_cast<Error>(result)};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue