/// flushBuffer - Dump the contents of the buffer to Stream.
///
- void flushBuffer(void) {
+ void flushBuffer() {
if (Filled)
// Write the older portion of the buffer.
TheStream->write(Cur, BufferArray + BufferSize - Cur);
Filled = false;
}
- virtual void write_impl(const char *Ptr, size_t Size);
+ void write_impl(const char *Ptr, size_t Size) override;
/// current_pos - Return the current position within the stream,
/// not counting the bytes currently in the buffer.
///
- virtual uint64_t current_pos() const {
+ uint64_t current_pos() const override {
// This has the same effect as calling TheStream.current_pos(),
// but that interface is private.
return TheStream->tell() - TheStream->GetNumBytesInBuffer();
circular_raw_ostream(raw_ostream &Stream, const char *Header,
size_t BuffSize = 0, bool Owns = REFERENCE_ONLY)
: raw_ostream(/*unbuffered*/true),
- TheStream(0),
+ TheStream(nullptr),
OwnsStream(Owns),
BufferSize(BuffSize),
- BufferArray(0),
+ BufferArray(nullptr),
Filled(false),
Banner(Header) {
if (BufferSize != 0)
Cur = BufferArray;
setStream(Stream, Owns);
}
- explicit circular_raw_ostream()
- : raw_ostream(/*unbuffered*/true),
- TheStream(0),
- OwnsStream(REFERENCE_ONLY),
- BufferArray(0),
- Filled(false),
- Banner("") {
- Cur = BufferArray;
- }
~circular_raw_ostream() {
flush();
/// flushBufferWithBanner - Force output of the buffer along with
/// a small header.
///
- void flushBufferWithBanner(void);
+ void flushBufferWithBanner();
private:
/// releaseStream - Delete the held stream if needed. Otherwise,