67 size_t bufferSizeToUse = 16384);
91 bool openedOk() const noexcept {
return status.wasOk(); }
100 void flush()
override;
101 int64 getPosition()
override;
102 bool setPosition (
int64)
override;
103 bool write (
const void*,
size_t)
override;
104 bool writeRepeatedByte (
uint8 byte,
size_t numTimesToRepeat)
override;
110 void* fileHandle =
nullptr;
111 Result status { Result::ok() };
112 int64 currentPosition = 0;
113 size_t bufferSize, bytesInBuffer = 0;
114 HeapBlock<char> buffer;
118 void flushInternal();
120 int64 setPositionInternal (int64);
121 ssize_t writeInternal (
const void*,
size_t);
An output stream that writes into a local file.
const Result & getStatus() const noexcept
Returns the status of the file stream.
const File & getFile() const
Returns the file that this stream is writing to.
bool failedToOpen() const noexcept
Returns true if the stream couldn't be opened for some reason.
bool openedOk() const noexcept
Returns true if the stream opened without problems.
Represents a local file or directory.
The base class for streams that write data to some kind of destination.
Represents the 'success' or 'failure' of an operation, and holds an associated error message to descr...
unsigned char uint8
A platform-independent 8-bit unsigned integer type.
long long int64
A platform-independent 64-bit integer type.