Expose filesystem errors on Writer.

This commit is contained in:
Jared Boone
2016-05-12 21:57:38 -07:00
parent 8655b6d915
commit 87505f833b
2 changed files with 20 additions and 0 deletions
+16
View File
@@ -44,6 +44,14 @@ public:
return file.write(buffer, bytes);
}
Optional<std::filesystem::filesystem_error> error() const override {
if( file.bad() ) {
return { file.error() };
} else {
return { };
}
}
private:
File file;
};
@@ -71,6 +79,14 @@ public:
return success;
}
Optional<std::filesystem::filesystem_error> error() const override {
if( file.bad() ) {
return { file.error() };
} else {
return { };
}
}
private:
struct fmt_pcm_t {
constexpr fmt_pcm_t(