mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-13 18:19:33 +00:00
Adapt filesystem_error to new File error handling, expose on File.
This commit is contained in:
@@ -37,11 +37,7 @@ namespace std {
|
|||||||
namespace filesystem {
|
namespace filesystem {
|
||||||
|
|
||||||
struct filesystem_error {
|
struct filesystem_error {
|
||||||
const BYTE err;
|
const uint32_t err;
|
||||||
|
|
||||||
operator bool() const {
|
|
||||||
return err != FR_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string what() const;
|
std::string what() const;
|
||||||
};
|
};
|
||||||
@@ -129,6 +125,14 @@ public:
|
|||||||
return err == FR_OK;
|
return err == FR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool bad() const {
|
||||||
|
return err != FR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::filesystem::filesystem_error error() const {
|
||||||
|
return { err };
|
||||||
|
}
|
||||||
|
|
||||||
bool read(void* const data, const size_t bytes_to_read);
|
bool read(void* const data, const size_t bytes_to_read);
|
||||||
bool write(const void* const data, const size_t bytes_to_write);
|
bool write(const void* const data, const size_t bytes_to_write);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user