Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/io/BufferedOutStream.h>
Public Member Functions | |
BufferedOutStream (OutStream &output, size_t size=default_size) | |
BufferedOutStream (OutStream *output, bool close=false, size_t size=default_size) | |
~BufferedOutStream () override | |
void | reset () |
void | setStream (OutStream &str) |
OutStream & | stream () const |
int | write (const char *buffer, int size) override |
int | write (char byte) override |
int | flush (void) override |
CString | lastErrorMessage (void) override |
bool | supportsANSI () const override |
Public Member Functions inherited from OutStream | |
virtual | ~OutStream (void) |
Static Public Attributes | |
static const int | default_size = 4096 |
Static Public Attributes inherited from OutStream | |
static OutStream & | null = _null |
This stream provides buffered action for a given output stream.
BufferedOutStream | ( | OutStream & | output, |
size_t | size = default_size |
||
) |
Build a buffer out stream.
output | Output stream to buffer in. |
size | Size of the buffer. |
BufferedOutStream | ( | OutStream * | output, |
bool | close = false , |
||
size_t | size = default_size |
||
) |
Build a buffer out stream.
output | Output stream to buffer in. |
close | If set to true, the underlying stream is closed at destruction time (default to false). |
size | Size of the buffer. |
|
override |
References BufferedOutStream::flush().
|
overridevirtual |
Cause the current stream to dump its buffer to the medium.
Implements OutStream.
References OutStream::write().
Referenced by BufferedOutStream::setStream(), BufferedOutStream::write(), and BufferedOutStream::~BufferedOutStream().
Return a message for the last error.
Reimplemented from OutStream.
References OutStream::lastErrorMessage().
void reset | ( | ) |
Reset the stream without flushing.
Change the buffered stream, flushing remaining content.
str | New stream. |
References BufferedOutStream::flush(), and elm::str().
|
inline |
Get the underlying output stream.
|
overridevirtual |
Test if the current stream knows how to decode ANSI special codes. The default implementation returns false.
Reimplemented from OutStream.
References OutStream::supportsANSI().
|
overridevirtual |
Write a byte to the stream.
byte | Byte to write. |
Reimplemented from OutStream.
References elm::io::byte(), and BufferedOutStream::flush().
|
overridevirtual |
This is the main method of an output stream: the given buffer is put on the stream.
buffer | Byte buffer to write. |
size | Size of the byte buffer. |
Implements OutStream.
References BufferedOutStream::flush(), and OutStream::write().
|
static |