Adapt filesystem_error to new File error handling, expose on File.

This commit is contained in:
Jared Boone 2016-05-12 21:55:39 -07:00
parent 1df505331a
commit 8655b6d915

View File

@ -37,11 +37,7 @@ namespace std {
namespace filesystem {
struct filesystem_error {
const BYTE err;
operator bool() const {
return err != FR_OK;
}
const uint32_t err;
std::string what() const;
};
@ -129,6 +125,14 @@ public:
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 write(const void* const data, const size_t bytes_to_write);