Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXException.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                          E x c e p t i o n  T y p e s                         *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,2010 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXEXCEPTION_H
00022 #define FXEXCEPTION_H
00023 
00024 
00025 namespace FX {
00026 
00027 /**
00028 * Generic catch-all exception.
00029 * An optional message may be passed in the constructor, which must be a string
00030 * literal constant.
00031 */
00032 class FXAPI FXException {
00033 private:
00034   const FXchar *message;
00035 private:
00036   static const FXchar exceptionName[];
00037 public:
00038   FXException():message(FXException::exceptionName){}
00039   FXException(const FXchar *msg):message(msg){}
00040   const FXchar *what() const { return message; }
00041  ~FXException(){}
00042   };
00043 
00044 
00045 /**
00046 * Generic error exception.
00047 */
00048 class FXAPI FXErrorException : public FXException {
00049 private:
00050   static const FXchar exceptionName[];
00051 public:
00052   FXErrorException():FXException(FXErrorException::exceptionName){}
00053   FXErrorException(const FXchar *msg):FXException(msg){}
00054   };
00055 
00056 
00057 /**
00058 * Index out of range.
00059 */
00060 class FXAPI FXRangeException : public FXErrorException {
00061 private:
00062   static const FXchar exceptionName[];
00063 public:
00064   FXRangeException():FXErrorException(FXRangeException::exceptionName){}
00065   FXRangeException(const FXchar *msg):FXErrorException(msg){}
00066   };
00067 
00068 
00069 /**
00070 * Invalid pointer.
00071 */
00072 class FXAPI FXPointerException : public FXErrorException {
00073 private:
00074   static const FXchar exceptionName[];
00075 public:
00076   FXPointerException():FXErrorException(FXPointerException::exceptionName){}
00077   FXPointerException(const FXchar *msg):FXErrorException(msg){}
00078   };
00079 
00080 
00081 /**
00082 * Generic resource exception.
00083 */
00084 class FXAPI FXResourceException : public FXException {
00085 private:
00086   static const FXchar exceptionName[];
00087 public:
00088   FXResourceException():FXException(FXResourceException::exceptionName){}
00089   FXResourceException(const FXchar *msg):FXException(msg){}
00090   };
00091 
00092 
00093 /**
00094 * Out of memory.
00095 */
00096 class FXAPI FXMemoryException : public FXResourceException {
00097 private:
00098   static const FXchar exceptionName[];
00099 public:
00100   FXMemoryException():FXResourceException(FXMemoryException::exceptionName){}
00101   FXMemoryException(const FXchar *msg):FXResourceException(msg){}
00102   };
00103 
00104 
00105 /**
00106 * Window exception.
00107 */
00108 class FXAPI FXWindowException : public FXResourceException {
00109 private:
00110   static const FXchar exceptionName[];
00111 public:
00112   FXWindowException():FXResourceException(FXWindowException::exceptionName){}
00113   FXWindowException(const FXchar *msg):FXResourceException(msg){}
00114   };
00115 
00116 
00117 /**
00118 * Image, cursor, bitmap exception.
00119 */
00120 class FXAPI FXImageException : public FXResourceException {
00121 private:
00122   static const FXchar exceptionName[];
00123 public:
00124   FXImageException():FXResourceException(FXImageException::exceptionName){}
00125   FXImageException(const FXchar *msg):FXResourceException(msg){}
00126   };
00127 
00128 
00129 /**
00130 * Font exception.
00131 */
00132 class FXAPI FXFontException : public FXResourceException {
00133 private:
00134   static const FXchar exceptionName[];
00135 public:
00136   FXFontException():FXResourceException(FXFontException::exceptionName){}
00137   FXFontException(const FXchar *msg):FXResourceException(msg){}
00138   };
00139 
00140 }
00141 
00142 #endif

Copyright © 1997-2010 Jeroen van der Zijp