30 AFileOutputStream(): mFile(
nullptr) {}
31 AFileOutputStream(
AString path,
bool append =
false);
33 virtual ~AFileOutputStream();
35 void write(
const char* src,
size_t size)
override;
37 void open(
bool append =
false);
40 AFileOutputStream(AFileOutputStream&& rhs)
noexcept {
41 operator=(std::move(rhs));
43 AFileOutputStream& operator=(AFileOutputStream&& rhs)
noexcept {
45 mPath = std::move(rhs.mPath);
50 FILE* nativeHandle()
const {
60 class WriteException:
public AIOException {
65 WriteException(
const AString &mPath) : mPath(mPath) {}
67 const AString& getPath()
const {
71 AString getMessage()
const noexcept override {
72 return "failed to write to file: " + mPath;