![]() |
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,2002 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (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 GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: FXException.h,v 1.6 2002/01/18 22:42:52 jeroen Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXEXCEPTION_H 00025 #define FXEXCEPTION_H 00026 00027 00028 00029 /// Generic catch-all exception 00030 class FXAPI FXException { 00031 private: 00032 const FXchar *message; 00033 private: 00034 static const FXchar exceptionName[]; 00035 public: 00036 FXException():message(FXException::exceptionName){} 00037 FXException(const FXchar *msg):message(msg){} 00038 const FXchar *what() const { return message; } 00039 ~FXException(){} 00040 }; 00041 00042 00043 /// Generic error exception 00044 class FXAPI FXErrorException : public FXException { 00045 private: 00046 static const FXchar exceptionName[]; 00047 public: 00048 FXErrorException():FXException(FXErrorException::exceptionName){} 00049 FXErrorException(const FXchar *msg):FXException(msg){} 00050 }; 00051 00052 00053 /// Index out of range 00054 class FXAPI FXRangeException : public FXErrorException { 00055 private: 00056 static const FXchar exceptionName[]; 00057 public: 00058 FXRangeException():FXErrorException(FXRangeException::exceptionName){} 00059 FXRangeException(const FXchar *msg):FXErrorException(msg){} 00060 }; 00061 00062 00063 /// Invalid pointer 00064 class FXAPI FXPointerException : public FXErrorException { 00065 private: 00066 static const FXchar exceptionName[]; 00067 public: 00068 FXPointerException():FXErrorException(FXPointerException::exceptionName){} 00069 FXPointerException(const FXchar *msg):FXErrorException(msg){} 00070 }; 00071 00072 00073 /// Generic resource exception 00074 class FXAPI FXResourceException : public FXException { 00075 private: 00076 static const FXchar exceptionName[]; 00077 public: 00078 FXResourceException():FXException(FXResourceException::exceptionName){} 00079 FXResourceException(const FXchar *msg):FXException(msg){} 00080 }; 00081 00082 00083 /// Out of memory 00084 class FXAPI FXMemoryException : public FXResourceException { 00085 private: 00086 static const FXchar exceptionName[]; 00087 public: 00088 FXMemoryException():FXResourceException(FXMemoryException::exceptionName){} 00089 FXMemoryException(const FXchar *msg):FXResourceException(msg){} 00090 }; 00091 00092 00093 #endif