71 size_t bufferSizeToUse = 16384);
95 bool openedOk() const noexcept {
return status.wasOk(); }
104 void flush()
override;
105 int64 getPosition()
override;
106 bool setPosition (int64)
override;
107 bool write (
const void*,
size_t)
override;
108 bool writeRepeatedByte (uint8
byte,
size_t numTimesToRepeat)
override;
114 void* fileHandle =
nullptr;
115 Result status { Result::ok() };
116 int64 currentPosition = 0;
117 size_t bufferSize, bytesInBuffer = 0;
122 void flushInternal();
124 int64 setPositionInternal (int64);
125 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.
Result truncate()
Attempts to truncate the file to the current write position.
Represents a local file or directory.
Very simple container class to hold a pointer to some data on the heap.
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...
#define JUCE_API
This macro is added to all JUCE public class declarations.