00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _UIEXCEPTION_H
00023 #define _UIEXCEPTION_H
00024
00025 #ifdef HAVE_CONFIG_H
00026 # include <config.h>
00027 #endif
00028
00029 #ifdef HAVE_EXCEPTION
00030 # include <exception>
00031 #endif
00032
00033 #ifdef HAVE_STRING
00034 # include <string>
00035 #endif
00036
00037 namespace YAPETUI {
00043 class UIException : public std::exception {
00044 private:
00045 std::string message;
00046
00047 public:
00048 inline UIException() throw() : exception(),
00049 message("Generic UI exception") {}
00050 inline UIException(std::string msg) throw() : exception(),
00051 message(msg) {}
00052 inline UIException(const UIException& ex) throw() {
00053 message = ex.message;
00054 }
00055 inline virtual ~UIException() throw() { }
00056 inline const UIException& operator=(const UIException& ex)
00057 throw() {
00058 if (this == &ex) return *this;
00059 message = ex.message;
00060 return *this;
00061 }
00062 inline virtual const char* what() const throw() {
00063 return message.c_str();
00064 }
00065 };
00066
00067 }
00068
00069 #endif // _UIEXCEPTION_H