Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/io/OutStream.h>
Public Member Functions | |
virtual | ~OutStream (void) |
virtual int | write (const char *buffer, int size)=0 |
virtual int | write (char byte) |
virtual int | flush (void)=0 |
virtual CString | lastErrorMessage (void) |
virtual bool | supportsANSI () const |
Static Public Attributes | |
static OutStream & | null = _null |
An output stream streams transfer a flow of bytes to another entity. It is an abstract interface that must be implemented by standard IO, files, pipes, compressors and so on.
|
pure virtual |
Cause the current stream to dump its buffer to the medium.
Implemented in BufferedOutStream, VarExpander, TeeOutStream, NullOutStream, MD5, BlockOutStream, WinOutStream, and UnixOutStream.
Referenced by TeeOutStream::flush(), VarExpander::flush(), and Output::flush().
Return a message for the last error.
Reimplemented in BufferedOutStream, VarExpander, TeeOutStream, MD5, WinOutStream, and UnixOutStream.
Referenced by Output::flush(), TeeOutStream::lastErrorMessage(), StreamPipe::lastErrorMessage(), VarExpander::lastErrorMessage(), BufferedOutStream::lastErrorMessage(), and Output::print().
|
virtual |
Test if the current stream knows how to decode ANSI special codes. The default implementation returns false.
Reimplemented in BufferedOutStream, VarExpander, TeeOutStream, and UnixOutStream.
Referenced by TeeOutStream::supportsANSI(), VarExpander::supportsANSI(), BufferedOutStream::supportsANSI(), and Output::supportsANSI().
|
virtual |
Write a byte to the stream.
byte | Byte to write. |
Reimplemented in BufferedOutStream, VarExpander, and BlockOutStream.
References elm::io::byte(), and OutStream::write().
|
pure virtual |
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. |
Implemented in BufferedOutStream, VarExpander, TeeOutStream, UnixOutStream, NullOutStream, MD5, BlockOutStream, and WinOutStream.
Referenced by BufferedOutStream::flush(), Output::format(), Output::print(), StreamPipe::proceed(), TeeOutStream::write(), OutStream::write(), BufferedOutStream::write(), VarExpander::write(), and Serializer::writeRaw().