14#include "IOutputStream.h"
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));
45 mPath = std::move(rhs.mPath);
50 FILE* nativeHandle()
const {
53 const AString& path()
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;
Opens a file for a binary write.
Definition AFileOutputStream.h:24
void write(const char *src, size_t size) override
Writes exact size bytes to stream. Blocking (waiting for write all data) is allowed.
Represents a Unicode character string.
Definition AString.h:38
Definition IOutputStream.h:18