mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-13 17:05:37 -04:00
Move file_wrapper and make testable. (#1085)
* WIP Move file_wrapper and make testable. * More tests, get text_editor compiling * Back to working * Run formatter --------- Co-authored-by: kallanreed <kallanreed@outlook.com>
This commit is contained in:
parent
23c24355ab
commit
e50d8dc148
7 changed files with 731 additions and 308 deletions
|
@ -60,7 +60,7 @@ File::~File() {
|
|||
f_close(&f);
|
||||
}
|
||||
|
||||
File::Result<File::Size> File::read(void* const data, const Size bytes_to_read) {
|
||||
File::Result<File::Size> File::read(void* data, Size bytes_to_read) {
|
||||
UINT bytes_read = 0;
|
||||
const auto result = f_read(&f, data, bytes_to_read, &bytes_read);
|
||||
if (result == FR_OK) {
|
||||
|
@ -70,7 +70,7 @@ File::Result<File::Size> File::read(void* const data, const Size bytes_to_read)
|
|||
}
|
||||
}
|
||||
|
||||
File::Result<File::Size> File::write(const void* const data, const Size bytes_to_write) {
|
||||
File::Result<File::Size> File::write(const void* data, Size bytes_to_write) {
|
||||
UINT bytes_written = 0;
|
||||
const auto result = f_write(&f, data, bytes_to_write, &bytes_written);
|
||||
if (result == FR_OK) {
|
||||
|
@ -84,7 +84,7 @@ File::Result<File::Size> File::write(const void* const data, const Size bytes_to
|
|||
}
|
||||
}
|
||||
|
||||
File::Result<File::Offset> File::seek(const Offset new_position) {
|
||||
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 result = f_lseek(&f, new_position);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue