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,2006 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.14 2006/01/22 17:58:01 fox Exp $                       *
00023 ********************************************************************************/
00024 #ifndef FXEXCEPTION_H
00025 #define FXEXCEPTION_H
00026 
00027 
00028 namespace FX {
00029 
00030 /// Generic catch-all exception
00031 class FXAPI FXException {
00032 private:
00033   const FXchar *message;
00034 private:
00035   static const FXchar exceptionName[];
00036 public:
00037   FXException():message(FXException::exceptionName){}
00038   FXException(const FXchar *msg):message(msg){}
00039   const FXchar *what() const { return message; }
00040   ~FXException(){}
00041   };
00042 
00043 
00044 /// Generic error exception
00045 class FXAPI FXErrorException : public FXException {
00046 private:
00047   static const FXchar exceptionName[];
00048 public:
00049   FXErrorException():FXException(FXErrorException::exceptionName){}
00050   FXErrorException(const FXchar *msg):FXException(msg){}
00051   };
00052 
00053 
00054 /// Index out of range
00055 class FXAPI FXRangeException : public FXErrorException {
00056 private:
00057   static const FXchar exceptionName[];
00058 public:
00059   FXRangeException():FXErrorException(FXRangeException::exceptionName){}
00060   FXRangeException(const FXchar *msg):FXErrorException(msg){}
00061   };
00062 
00063 
00064 /// Invalid pointer
00065 class FXAPI FXPointerException : public FXErrorException {
00066 private:
00067   static const FXchar exceptionName[];
00068 public:
00069   FXPointerException():FXErrorException(FXPointerException::exceptionName){}
00070   FXPointerException(const FXchar *msg):FXErrorException(msg){}
00071   };
00072 
00073 
00074 /// Generic resource exception
00075 class FXAPI FXResourceException : public FXException {
00076 private:
00077   static const FXchar exceptionName[];
00078 public:
00079   FXResourceException():FXException(FXResourceException::exceptionName){}
00080   FXResourceException(const FXchar *msg):FXException(msg){}
00081   };
00082 
00083 
00084 /// Out of memory
00085 class FXAPI FXMemoryException : public FXResourceException {
00086 private:
00087   static const FXchar exceptionName[];
00088 public:
00089   FXMemoryException():FXResourceException(FXMemoryException::exceptionName){}
00090   FXMemoryException(const FXchar *msg):FXResourceException(msg){}
00091   };
00092 
00093 
00094 /// Window exception
00095 class FXAPI FXWindowException : public FXResourceException {
00096 private:
00097   static const FXchar exceptionName[];
00098 public:
00099   FXWindowException():FXResourceException(FXWindowException::exceptionName){}
00100   FXWindowException(const FXchar *msg):FXResourceException(msg){}
00101   };
00102 
00103 
00104 /// Image, cursor, bitmap exception
00105 class FXAPI FXImageException : public FXResourceException {
00106 private:
00107   static const FXchar exceptionName[];
00108 public:
00109   FXImageException():FXResourceException(FXImageException::exceptionName){}
00110   FXImageException(const FXchar *msg):FXResourceException(msg){}
00111   };
00112 
00113 
00114 /// Font exception
00115 class FXAPI FXFontException : public FXResourceException {
00116 private:
00117   static const FXchar exceptionName[];
00118 public:
00119   FXFontException():FXResourceException(FXFontException::exceptionName){}
00120   FXFontException(const FXchar *msg):FXResourceException(msg){}
00121   };
00122 
00123 }
00124 
00125 #endif

Copyright © 1997-2005 Jeroen van der Zijp