PUMA Library Reference Manual
|
#include <Puma/ErrorSink.h>
This is an interface for classes that may be used to consume error messages during a process where many errors can occur like parsing a program.
The error information is handed over to the ErrorSink in stream-like style. Different severities of errors are predefined and can be used to classify error information that follows. Also a location can be handed over to the ErrorSink to specify where the error was found (filename, line, etc.). The error information itself can be of any standard data type or anything that implements the Printable interface. An error message is finished with the Puma::endMessage stream manipulator.
Specializations of this class could either build and print error messages or collect them for a later processing.
Public Member Functions | |
virtual | ~ErrorSink () |
Destructor. | |
virtual ErrorSink & | operator<< (const char *str)=0 |
Add given string to current error message. | |
virtual ErrorSink & | operator<< (long value)=0 |
Add given long integer value to current error message. | |
virtual ErrorSink & | operator<< (unsigned value)=0 |
Add given unsigned integer value to current error message. | |
virtual ErrorSink & | operator<< (int value)=0 |
Add given signed integer value to current error message. | |
virtual ErrorSink & | operator<< (short value)=0 |
Add given short integer value to current error message. | |
virtual ErrorSink & | operator<< (char c)=0 |
Add given character to current error message. | |
virtual ErrorSink & | operator<< (double value)=0 |
Add given floating point value to current error message. | |
virtual ErrorSink & | operator<< (const ErrorSeverity &severity)=0 |
Change the severity of the current error message. | |
virtual ErrorSink & | operator<< (Location location)=0 |
Set the location the error occurred. | |
virtual ErrorSink & | operator<< (const Printable &obj)=0 |
Add the serialized value of the given object to the current error message. | |
virtual ErrorSink & | operator<< (void(*fct)(ErrorSink &))=0 |
Apply the given stream manipulator. | |
virtual void | endMessage ()=0 |
Finish the current error message. | |
|
inlinevirtual |
Destructor.
|
pure virtual |
Finish the current error message.
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.
|
pure virtual |
Add given character to current error message.
c | The character to add. |
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.
|
pure virtual |
Add given string to current error message.
str | The string to add. |
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.
|
pure virtual |
Change the severity of the current error message.
severity | The new severity. |
Implemented in Puma::ErrorStream, and Puma::ErrorCollector.
Add the serialized value of the given object to the current error message.
obj | The object to serialize. |
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.
|
pure virtual |
Add given floating point value to current error message.
value | The value to add. |
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.
|
pure virtual |
Add given signed integer value to current error message.
value | The value to add. |
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.
Set the location the error occurred.
location | The error location. |
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.
|
pure virtual |
Add given long integer value to current error message.
value | The value to add. |
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.
|
pure virtual |
Add given short integer value to current error message.
value | The value to add. |
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.
|
pure virtual |
Add given unsigned integer value to current error message.
value | The value to add. |
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.
Apply the given stream manipulator.
fct | The stream manipulator function. |
Implemented in Puma::ErrorCollector, and Puma::ErrorStream.