00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #ifndef GCN_EXCEPTION_HPP
00056 #define GCN_EXCEPTION_HPP
00057
00058 #include <string>
00059
00060 #include "guichan/platform.h"
00061
00062
00063 #if _MSC_VER <= 1200
00064 #define __FUNCTION__ "?"
00065 #endif
00066
00067
00068
00069
00070
00071
00072
00073 #define GCN_EXCEPTION(mess) gcn::Exception(mess, \
00074 __FUNCTION__, \
00075 __FILE__, \
00076 __LINE__)
00077
00078 namespace gcn
00079 {
00080
00094 class GCN_CORE_DECLSPEC Exception
00095 {
00096 public:
00097
00101 Exception();
00102
00108 Exception(const std::string& message);
00109
00120 Exception(const std::string& message,
00121 const std::string& function,
00122 const std::string& filename,
00123 int line);
00124
00130 const std::string& getFunction() const;
00131
00137 const std::string& getMessage() const;
00138
00144 const std::string& getFilename() const;
00145
00151 int getLine() const;
00152
00153 protected:
00154 std::string mFunction;
00155 std::string mMessage;
00156 std::string mFilename;
00157 int mLine;
00158 };
00159 }
00160
00161 #endif // end GCN_EXCEPTION_HPP
00162
00163
00164
00165
00166
00167