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