00001 00002 00003 00004 //----------------------------------------------------------------------------- 00005 // CVS: $Revision: 2101 $, $Date: 2006-04-17 17:51:20 +0100 (Mon, 17 Apr 2006) $, $Author: rsc $ 00006 //----------------------------------------------------------------------------- 00007 #ifndef MYEXCEPTION_H 00008 #define MYEXCEPTION_H 00009 00010 #include <string> 00011 //----------------------------------------------------------------------------- 00020 class MyException 00021 { 00022 public: 00023 MyException() { } 00024 00025 MyException(const std::string& aMsg) : mMsg(aMsg) { } 00026 00027 MyException(const std::string& aIntroMsg, 00028 const std::string& aMsg) 00029 : mIntroMsg(aIntroMsg), 00030 mMsg(aMsg) { } 00031 00032 std::string what() const { return mIntroMsg + mMsg; } 00033 00034 protected: 00035 std::string mIntroMsg; 00036 std::string mMsg; 00037 }; 00038 //----------------------------------------------------------------------------- 00039 #endif 00040 //----------------------------------------------------------------------------- 00041 // Change log: 00042 // 18-Nov-2003, IAB: Original version. 00043 // 16-Nov-2005, RSC: Redesigned MyException, tidied up std namespace