Device for writing to standard output. More...
#include <console.hpp>
Public Member Functions | |
const Error & | error () const |
Returns the most recent error status. More... | |
void | flush () |
Flush the internal buffer. More... | |
OConsole () | |
Default constructor. More... | |
bool | open () |
Dummy handle to satisfy the output device concept. More... | |
long | write (const char &c) |
Write a character to the buffer. More... | |
long | write (const char *s, unsigned long n) |
Write a character string to the buffer. More... | |
virtual | ~OConsole () |
Private Attributes | |
devices::CharStringBuffer | buffer |
Error | error_handler |
Device for writing to standard output.
Device for writing to standard output. It creates a wrapper class around the stdout handle from cstdio to implement an ecl output device. Do not use this directly, it serves only as the device handle for the console stream classes.
Definition at line 49 of file console.hpp.
|
inline |
Default constructor.
Definition at line 62 of file console.hpp.
|
inlinevirtual |
Definition at line 63 of file console.hpp.
|
inline |
Returns the most recent error status.
Use this to check on the status of the object after a method has been called. Mostly this is here to serve as a graceful fallback for when exceptions are disabled.
Definition at line 117 of file console.hpp.
void ecl::OConsole::flush | ( | ) |
Flush the internal buffer.
Flushes the userspace buffers to standard output.
StandardException | : throws if flushing returned an error [debug mode only]. |
Definition at line 53 of file console.cpp.
|
inline |
Dummy handle to satisfy the output device concept.
For console devices this does nothing - the standard output is always open. It is just a dummy handle built to ensure the output device concept is satisfied.
Definition at line 76 of file console.hpp.
long ecl::OConsole::write | ( | const char & | c | ) |
Write a character to the buffer.
Write a character to the buffer. It will automatically flush if the buffer exceeds its capacity.
c | : the character to write. |
StandardException | : throws if writing returned an error [debug mode only]. |
Definition at line 32 of file console.cpp.
long ecl::OConsole::write | ( | const char * | s, |
unsigned long | n | ||
) |
Write a character string to the buffer.
Write a character string to the buffer. It will automatically flush if the buffer exceeds its capacity.
s | : points to the beginning of the character string |
n | : the number of characters to write. |
StandardException | : throws if flushing returned an error [debug mode only]. |
Definition at line 41 of file console.cpp.
|
private |
Definition at line 119 of file console.hpp.
|
private |
Definition at line 120 of file console.hpp.