00001 #ifndef UTILSEXC_HEADER
00002 #define UTILSEXC_HEADER
00003
00004
00005
00012
00013
00014
00015
00016 #include <stdlib.h>
00017
00018 #ifdef _STANDARD_C_PLUS_PLUS
00019 #include <iostream>
00020 #include <iomanip>
00021 #include <sstream>
00022 #else
00023 #include <iostream.h>
00024 #include <iomanip.h>
00025 #include <strstream.h>
00026 #define istringstream istrstream
00027 #define ostringstream ostrstream
00028 #endif
00029
00030 #include <string>
00031 using namespace std;
00032 #ifndef NPOS
00033 #define NPOS string::npos
00034 #endif
00035
00036
00037
00038 namespace RazorBack {
00039
00045 class Utilsexc_
00046 {
00047
00048 private:
00049 string Throwname;
00050 bool Fatal;
00051
00052 protected:
00053 string Message;
00054
00055
00056 public:
00057
00066 explicit Utilsexc_(const char *Thnm, bool F=false, const char *Msg=NULL);
00067
00069 const string& throw_name() const { return Throwname; }
00070
00072 const string& error_message() const { return Message; }
00073
00075 bool is_fatal() const { return Fatal; }
00076
00077
00078 protected:
00079
00080 void print_prefix(ostringstream& Ost) const;
00081
00082 private:
00083 Utilsexc_();
00084 };
00085
00086
00092 class Emptyexc_: public Utilsexc_
00093 {
00094
00095 public:
00096
00098 explicit Emptyexc_(const char *Thnm, bool F=false);
00099
00100 private:
00101 Emptyexc_();
00102 };
00103
00104
00105 }
00106
00107
00108
00109 #endif // UTILSEXC_HEADER