• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ui/uiexception.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //
00003 // $Id: uiexception.h 3342 2010-09-17 18:32:00Z java $
00004 //
00005 // Copyright (C) 2008-2010  Rafael Ostertag
00006 //
00007 // This file is part of YAPET.
00008 //
00009 // YAPET is free software: you can redistribute it and/or modify it under the
00010 // terms of the GNU General Public License as published by the Free Software
00011 // Foundation, either version 3 of the License, or (at your option) any later
00012 // version.
00013 //
00014 // YAPET is distributed in the hope that it will be useful, but WITHOUT ANY
00015 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00016 // FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00017 // details.
00018 //
00019 // You should have received a copy of the GNU General Public License along with
00020 // YAPET.  If not, see <http://www.gnu.org/licenses/>.
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 YAPET {
00041     namespace UI {
00047         class UIException : public std::exception {
00048             private:
00049                 std::string message;
00050 
00051             public:
00052                 inline UIException() throw() : exception(),
00053                         message (_ ("Generic UI exception") ) {}
00054                 inline UIException (std::string msg) throw() : exception(),
00055                         message (msg) {}
00056                 inline UIException (const UIException& ex) throw() {
00057                     message = ex.message;
00058                 }
00059                 inline virtual ~UIException() throw() { /* empty */ }
00060                 inline const UIException& operator= (const UIException& ex)
00061                 throw() {
00062                     if (this == &ex) return *this;
00063 
00064                     message = ex.message;
00065                     return *this;
00066                 }
00067                 inline virtual const char* what() const throw() {
00068                     return message.c_str();
00069                 }
00070         };
00071 
00072     }
00073 }
00074 #endif // _UIEXCEPTION_H

Generated on Sun Sep 19 2010 15:37:13 for YAPET by  doxygen 1.7.1