#include <CUI_ErrorHandler.h>
Public Types | |
enum | errorType { UI_WARNING, UI_ERROR, UI_FATAL } |
Types of errors to handle. | |
Public Member Functions | |
CUI_ErrorHandler (char *filename) | |
virtual | ~CUI_ErrorHandler () |
virtual CUI_MessageBox * | ProcessError (errorType type, char *message) |
Process an error. | |
virtual bool | SetConsole (CUI_Console *con) |
Set the console object to log to. | |
virtual bool | SetMessageBox (CUI_MessageBox *mbox) |
Set the message box object. | |
virtual bool | SetReporting (unsigned short report) |
Set the reporting type flag. | |
Static Public Attributes | |
const unsigned short | UI_REPORT_NONE = 0x0001 |
const unsigned short | UI_REPORT_FILE = 0x0002 |
const unsigned short | UI_REPORT_CONSOLE = 0x0004 |
const unsigned short | UI_REPORT_MESSAGEBOX = 0x0008 |
Protected Member Functions | |
virtual bool | OpenFile (char *filename) |
Open a file for logging. | |
virtual bool | WriteToFile (char *text) |
Write to the open file. | |
virtual bool | CloseFile () |
Close the open file. | |
Protected Attributes | |
FILE * | m_filep |
file pointer for basic output | |
bool | m_fileOpen |
Is the logging file open? | |
unsigned short | m_report |
Type of error reporting currently enabled. | |
CUI_Console * | m_console |
The console to log to. | |
CUI_MessageBox * | m_messageBox |
The message box to use. |
Used internally by the core UI to report errors, and can also be used by the application to display errors within the GUI.
Can display error messages in a message box, log to the console, and/or log to a text file.
Inherit from this class to change the message formatting (to any destination) or change the way file i/o is handled.
|
Should be instantiated by the application and passed to the CUI_UI object. |
|
Close the file and delete anything else allocated |
|
Process an error. Returns a pointer to the message box so the UI can display it |