Public Member Functions | Private Attributes | List of all members
ecl::EConsole Class Reference

Device for writing o standard error. More...

#include <console.hpp>

Public Member Functions

 EConsole ()
 Default constructor. More...
 
const Errorerror () const
 Returns the most recent error status. More...
 
void flush ()
 Flush the internal buffer. 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 ~EConsole ()
 

Private Attributes

devices::CharStringBuffer buffer
 
Error error_handler
 

Detailed Description

Device for writing o standard error.

Device for writing to standard error. Do not use this directly, it serves only as the device handle for the console stream classes.

Definition at line 126 of file console.hpp.

Constructor & Destructor Documentation

◆ EConsole()

ecl::EConsole::EConsole ( )
inline

Default constructor.

Definition at line 133 of file console.hpp.

◆ ~EConsole()

virtual ecl::EConsole::~EConsole ( )
inlinevirtual

Definition at line 134 of file console.hpp.

Member Function Documentation

◆ error()

const Error& ecl::EConsole::error ( ) const
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.

Returns

Definition at line 188 of file console.hpp.

◆ flush()

void ecl::EConsole::flush ( )

Flush the internal buffer.

Flushes the userspace buffers to standard output.

Exceptions
StandardException: throws if flushing returned an error [debug mode only].

Definition at line 85 of file console.cpp.

◆ open()

bool ecl::EConsole::open ( )
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.

Returns
bool : always returns true (it is always open).

Definition at line 147 of file console.hpp.

◆ write() [1/2]

long ecl::EConsole::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.

Parameters
c: the character to write.
Returns
long : the number of bytes written.
Exceptions
StandardException: throws if writing returned an error [debug mode only].

Definition at line 64 of file console.cpp.

◆ write() [2/2]

long ecl::EConsole::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.

Parameters
s: points to the beginning of the character string
n: the number of characters to write.
Returns
long: the number of bytes written.
Exceptions
StandardException: throws if flushing returned an error [debug mode only].

Definition at line 73 of file console.cpp.

Member Data Documentation

◆ buffer

devices::CharStringBuffer ecl::EConsole::buffer
private

Definition at line 191 of file console.hpp.

◆ error_handler

Error ecl::EConsole::error_handler
private

Definition at line 192 of file console.hpp.


The documentation for this class was generated from the following files:


ecl_devices
Author(s): Daniel Stonier
autogenerated on Sun Aug 2 2020 03:12:18