00001
00005 #include <iostream>
00006 #include <exception>
00007
00008 #define SEV_INFO 0
00009 #define SEV_WARN 1
00010 #define SEV_ERROR 2
00011 #define SEV_FATAL 4
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 class CSCReadException : public std::exception
00029 {
00030 private:
00031 std::string file, message;
00032 unsigned int line;
00033 char txt[200];
00034 int severity;
00035
00036 public:
00037 CSCReadException(const std::string &file, unsigned int line, const std::string &message = "", int severity = 0);
00038 CSCReadException(const std::string &message = "");
00039 virtual ~CSCReadException() throw();
00040 virtual const char * what() const throw();
00041 int IsInfo() {return (severity==SEV_INFO);};
00042 int isWarning() {return (severity==SEV_WARN);};
00043 int isError() {return (severity==SEV_ERROR);};
00044 int isFatal() {return (severity==SEV_FATAL);};
00045 int GetSeverity() {return severity;};
00046
00047 };
00048
00049 #define THROW_EXCEPTION(ErrorString, severity) throw CSCReadException(__FILE__, __LINE__, ErrorString, severity)
00050
00051