00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __J2K__THROWABLE_HPP__
00015 #define __J2K__THROWABLE_HPP__
00016
00017 #include <j2k/Fred/String/String.hpp>
00018
00019 typedef JString String;
00020
00021
00022 class Throwable
00023 {
00024 public:
00025 Throwable()
00026 {
00027
00028 }
00029
00030 Throwable(String* s)
00031 {
00032
00033 detailMessage = s;
00034 }
00035
00036 String& getMessage()
00037 {
00038 return *detailMessage;
00039 }
00040
00041 String& getLocalizedMessage()
00042 {
00043 return getMessage();
00044 }
00045
00046 String* toString()
00047 {
00048 const char* s = "getName()";
00049 String* s2;
00050
00051
00052 const char* s1 = detailMessage->string();
00053 char* buf = new char[160];
00054 if (s1 != NULL) {
00055 sprintf( buf, "%s : %s", s, s1 );
00056 } else {
00057 sprintf( buf, "%s", s );
00058 }
00059
00060 s2 = new String( buf );
00061
00062 delete[] buf;
00063
00064 return s2;
00065 }
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 void fillInStackTrace() {
00090
00091 cout << "!";
00092 }
00093
00094 private:
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 String* detailMessage;
00105
00106 };
00107
00108 #endif