00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00030 #ifndef __CLAW_EXCEPTION_HPP__
00031 #define __CLAW_EXCEPTION_HPP__
00032
00033 #include <exception>
00034 #include <string>
00035
00036 namespace claw
00037 {
00042 class exception : public std::exception
00043 {
00044 public:
00049 exception( const std::string& msg ) throw()
00050 : m_msg(msg)
00051 { }
00052
00054 ~exception() throw() {}
00055
00057 const char* what() const throw() { return m_msg.c_str(); }
00058
00059 private:
00061 const std::string m_msg;
00062
00063 };
00064
00069 class bad_format : public exception
00070 {
00071 public:
00076 bad_format( const std::string& msg ) throw()
00077 : exception(msg)
00078 { }
00079 };
00080
00081 }
00082
00088 #define CLAW_EXCEPTION( m ) \
00089 claw::exception( std::string(__FUNCTION__) + ": " + m )
00090
00091 #endif // __CLAW_EXCEPTION_HPP__