Initial commit. Not even a game yet :P
[cToan.git] / src / ErrorHandler.hpp
blob531c4b2466a232365ba154a5b90b71882db1127e
1 /* ErrorHandler.hpp
2 */
4 #ifndef _ERRORHANDLER_H_
5 #define _ERRORHANDLER_H_
7 #include <iostream>
9 #include "SDL/SDL.h" // For SDL_GetError()
11 // Put in namespace?
13 class ErrorHandler
15 public:
16 /* This enum holds the type of errors I might wanna report, Fatal errors will have the program exit/quit/abort
17 * while others can be handled accordingly.
19 enum ErrorType {
20 FATAL_CONSTRUCTOR_ERROR = 0,
21 NONFATAL_CONSTRUCTOR_ERROR,
22 FATAL_ERROR,
23 NONFATAL_ERROR
26 /* This function is the main error handling function, therefore being declared static so all can use it without
27 * actually creating an ErrorHandler object. Internally it outputs the error to stderr and to a log file.
29 static void OutputError(ErrorType eType, std::string Error);
32 #endif