![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
00001 /******************************************************************************** 00002 * * 00003 * E x c e p t i o n T y p e s * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2000,2009 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 * $Id: FXException.h,v 1.21 2009/01/06 13:07:23 fox Exp $ * 00022 ********************************************************************************/ 00023 #ifndef FXEXCEPTION_H 00024 #define FXEXCEPTION_H 00025 00026 00027 namespace FX { 00028 00029 /** 00030 * Generic catch-all exception. 00031 * An optional message may be passed in the constructor, which must be a string 00032 * literal constant. 00033 */ 00034 class FXAPI FXException { 00035 private: 00036 const FXchar *message; 00037 private: 00038 static const FXchar exceptionName[]; 00039 public: 00040 FXException():message(FXException::exceptionName){} 00041 FXException(const FXchar *msg):message(msg){} 00042 const FXchar *what() const { return message; } 00043 ~FXException(){} 00044 }; 00045 00046 00047 /** 00048 * Generic error exception. 00049 */ 00050 class FXAPI FXErrorException : public FXException { 00051 private: 00052 static const FXchar exceptionName[]; 00053 public: 00054 FXErrorException():FXException(FXErrorException::exceptionName){} 00055 FXErrorException(const FXchar *msg):FXException(msg){} 00056 }; 00057 00058 00059 /** 00060 * Index out of range. 00061 */ 00062 class FXAPI FXRangeException : public FXErrorException { 00063 private: 00064 static const FXchar exceptionName[]; 00065 public: 00066 FXRangeException():FXErrorException(FXRangeException::exceptionName){} 00067 FXRangeException(const FXchar *msg):FXErrorException(msg){} 00068 }; 00069 00070 00071 /** 00072 * Invalid pointer. 00073 */ 00074 class FXAPI FXPointerException : public FXErrorException { 00075 private: 00076 static const FXchar exceptionName[]; 00077 public: 00078 FXPointerException():FXErrorException(FXPointerException::exceptionName){} 00079 FXPointerException(const FXchar *msg):FXErrorException(msg){} 00080 }; 00081 00082 00083 /** 00084 * Generic resource exception. 00085 */ 00086 class FXAPI FXResourceException : public FXException { 00087 private: 00088 static const FXchar exceptionName[]; 00089 public: 00090 FXResourceException():FXException(FXResourceException::exceptionName){} 00091 FXResourceException(const FXchar *msg):FXException(msg){} 00092 }; 00093 00094 00095 /** 00096 * Out of memory. 00097 */ 00098 class FXAPI FXMemoryException : public FXResourceException { 00099 private: 00100 static const FXchar exceptionName[]; 00101 public: 00102 FXMemoryException():FXResourceException(FXMemoryException::exceptionName){} 00103 FXMemoryException(const FXchar *msg):FXResourceException(msg){} 00104 }; 00105 00106 00107 /** 00108 * Window exception. 00109 */ 00110 class FXAPI FXWindowException : public FXResourceException { 00111 private: 00112 static const FXchar exceptionName[]; 00113 public: 00114 FXWindowException():FXResourceException(FXWindowException::exceptionName){} 00115 FXWindowException(const FXchar *msg):FXResourceException(msg){} 00116 }; 00117 00118 00119 /** 00120 * Image, cursor, bitmap exception. 00121 */ 00122 class FXAPI FXImageException : public FXResourceException { 00123 private: 00124 static const FXchar exceptionName[]; 00125 public: 00126 FXImageException():FXResourceException(FXImageException::exceptionName){} 00127 FXImageException(const FXchar *msg):FXResourceException(msg){} 00128 }; 00129 00130 00131 /** 00132 * Font exception. 00133 */ 00134 class FXAPI FXFontException : public FXResourceException { 00135 private: 00136 static const FXchar exceptionName[]; 00137 public: 00138 FXFontException():FXResourceException(FXFontException::exceptionName){} 00139 FXFontException(const FXchar *msg):FXResourceException(msg){} 00140 }; 00141 00142 } 00143 00144 #endif
![]() |