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

FXException.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * E x c e p t i o n T y p e s *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2000,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXException.h,v 1.14 2006/01/22 17:58:01 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXEXCEPTION_H
25 #define FXEXCEPTION_H
26 
27 
28 namespace FX {
29 
30 /// Generic catch-all exception
32 private:
33  const FXchar *message;
34 private:
35  static const FXchar exceptionName[];
36 public:
37  FXException():message(FXException::exceptionName){}
38  FXException(const FXchar *msg):message(msg){}
39  const FXchar *what() const { return message; }
40  ~FXException(){}
41  };
42 
43 
44 /// Generic error exception
45 class FXAPI FXErrorException : public FXException {
46 private:
47  static const FXchar exceptionName[];
48 public:
50  FXErrorException(const FXchar *msg):FXException(msg){}
51  };
52 
53 
54 /// Index out of range
56 private:
57  static const FXchar exceptionName[];
58 public:
61  };
62 
63 
64 /// Invalid pointer
66 private:
67  static const FXchar exceptionName[];
68 public:
70  FXPointerException(const FXchar *msg):FXErrorException(msg){}
71  };
72 
73 
74 /// Generic resource exception
76 private:
77  static const FXchar exceptionName[];
78 public:
80  FXResourceException(const FXchar *msg):FXException(msg){}
81  };
82 
83 
84 /// Out of memory
86 private:
87  static const FXchar exceptionName[];
88 public:
91  };
92 
93 
94 /// Window exception
96 private:
97  static const FXchar exceptionName[];
98 public:
101  };
102 
103 
104 /// Image, cursor, bitmap exception
105 class FXAPI FXImageException : public FXResourceException {
106 private:
107  static const FXchar exceptionName[];
108 public:
109  FXImageException():FXResourceException(FXImageException::exceptionName){}
110  FXImageException(const FXchar *msg):FXResourceException(msg){}
111  };
112 
113 
114 /// Font exception
115 class FXAPI FXFontException : public FXResourceException {
116 private:
117  static const FXchar exceptionName[];
118 public:
119  FXFontException():FXResourceException(FXFontException::exceptionName){}
120  FXFontException(const FXchar *msg):FXResourceException(msg){}
121  };
122 
123 }
124 
125 #endif
Generic catch-all exception.
Definition: FXException.h:31
char FXchar
Definition: fxdefs.h:387
Window exception.
Definition: FXException.h:81
#define FXAPI
Definition: fxdefs.h:122
Index out of range.
Definition: FXException.h:49
Invalid pointer.
Definition: FXException.h:57
Generic error exception.
Definition: FXException.h:41
Generic resource exception.
Definition: FXException.h:65
Out of memory.
Definition: FXException.h:73

Copyright © 1997-2005 Jeroen van der Zijp