PUMA Library Reference Manual
|
#include <Puma/ErrorStream.h>
An error stream is a special ErrorSink that prints out an error message as soon as it is complete.
It also stores the maximum error severity. The error stream can be reset to its initial state.
Public Member Functions | |
ErrorStream (std::ostream &out=std::cerr) | |
Constructor. | |
virtual | ~ErrorStream () |
Destructor. | |
ErrorStream & | operator<< (const char *str) |
Add given string to current error message. | |
ErrorStream & | operator<< (long value) |
Add given long integer value to current error message. | |
ErrorStream & | operator<< (unsigned value) |
Add given unsigned integer value to current error message. | |
ErrorStream & | operator<< (int value) |
Add given signed integer value to current error message. | |
ErrorStream & | operator<< (short value) |
Add given short integer value to current error message. | |
ErrorStream & | operator<< (char c) |
Add given character to current error message. | |
ErrorStream & | operator<< (double value) |
Add given floating point value to current error message. | |
ErrorStream & | operator<< (const ErrorSeverity &sev) |
Change the severity of the current error message. | |
ErrorStream & | operator<< (Location location) |
Set the location the error occurred. | |
ErrorStream & | operator<< (const Printable &obj) |
Add the serialized value of the given object to the current error message. | |
ErrorStream & | operator<< (void(*fct)(ErrorSink &)) |
Apply the given stream manipulator. | |
void | endMessage () |
Finish the current error message. | |
void | reset () |
Reset the error stream to its initial state. | |
bool | silent () |
Turn to silent mode. | |
bool | loud () |
Turn to loud mode. | |
ErrorSeverity | severity () const |
Get the current error severity. | |
void | severity (ErrorSeverity &sev) |
Set a new severity for all following messages. | |
Public Member Functions inherited from Puma::ErrorSink | |
virtual | ~ErrorSink () |
Destructor. | |
|
inline |
Constructor.
out | The output stream to use. Defaults to std::cerr. |
|
inlinevirtual |
Destructor.
|
virtual |
Finish the current error message.
Implements Puma::ErrorSink.
bool Puma::ErrorStream::loud | ( | ) |
Turn to loud mode.
In loud mode messages are printed on the output stream. This is the default mode.
|
virtual |
Add given character to current error message.
c | The character to add. |
Implements Puma::ErrorSink.
|
virtual |
Add given string to current error message.
str | The string to add. |
Implements Puma::ErrorSink.
|
virtual |
Change the severity of the current error message.
sev | The new severity. |
Implements Puma::ErrorSink.
|
virtual |
Add the serialized value of the given object to the current error message.
obj | The object to serialize. |
Implements Puma::ErrorSink.
|
virtual |
Add given floating point value to current error message.
value | The value to add. |
Implements Puma::ErrorSink.
|
virtual |
Add given signed integer value to current error message.
value | The value to add. |
Implements Puma::ErrorSink.
|
virtual |
Set the location the error occurred.
location | The error location. |
Implements Puma::ErrorSink.
|
virtual |
Add given long integer value to current error message.
value | The value to add. |
Implements Puma::ErrorSink.
|
virtual |
Add given short integer value to current error message.
value | The value to add. |
Implements Puma::ErrorSink.
|
virtual |
Add given unsigned integer value to current error message.
value | The value to add. |
Implements Puma::ErrorSink.
|
virtual |
Apply the given stream manipulator.
fct | The stream manipulator function. |
Implements Puma::ErrorSink.
void Puma::ErrorStream::reset | ( | ) |
Reset the error stream to its initial state.
|
inline |
Get the current error severity.
|
inline |
Set a new severity for all following messages.
sev | The new severity. |
bool Puma::ErrorStream::silent | ( | ) |
Turn to silent mode.
In silent mode no message is printed on the output stream.