Error.h
Go to the documentation of this file.00001 #if !defined(_ERROR_H)
00002
00003 using namespace std;
00004 #include <string>
00005 #include <stdarg.h>
00006
00007 enum ErrorLevel { NOERROR=0, WARNING, MINOR, SERIOUS, FATAL };
00008
00009 class Error
00010 {
00011 public:
00012
00013 Error();
00014 Error(ErrorLevel errlev);
00015 Error(ErrorLevel errlev, string message);
00016 Error(ErrorLevel errlev, char* fmt, ... );
00017 Error(int errlev);
00018 Error(int errlev, string message);
00019 Error(int errlev, char* fmt, ... );
00020 ~Error();
00021
00022 void notify(ErrorLevel errlev, string message);
00023 void notify(string message);
00024
00025 static void setAcceptableLevel(ErrorLevel errlev);
00026 static ErrorLevel getAcceptableLevel();
00027 static string getAcceptableLevelToString();
00028
00029 static ErrorLevel getLevel();
00030 static string getLevelToString();
00031 static string getErrorMessage();
00032
00033 static void clearMessage();
00034 static void clearErrLev();
00035
00036 private:
00037 static ErrorLevel acceptableErrorLevel;
00038 static string errorMessage_;
00039 static ErrorLevel errlev_;
00040 string errorLog;
00041 void printMessage( string message);
00042 };
00043
00044 #define _ERROR_H
00045 #endif