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

FXException.h
1 /********************************************************************************
2 * *
3 * E x c e p t i o n T y p e s *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2000,2024 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (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 *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXEXCEPTION_H
22 #define FXEXCEPTION_H
23 
24 namespace FX {
25 
26 
32 class FXAPI FXException {
33 private:
34  const FXchar *message;
35 private:
36  static const FXchar exceptionName[];
37 public:
38  FXException():message(FXException::exceptionName){}
39  FXException(const FXchar *msg):message(msg){}
40  const FXchar *what() const { return message; }
41  ~FXException(){}
42  };
43 
44 
48 class FXAPI FXFatalException : public FXException {
49 private:
50  static const FXchar exceptionName[];
51 public:
52  FXFatalException():FXException(FXFatalException::exceptionName){}
53  FXFatalException(const FXchar *msg):FXException(msg){}
54  };
55 
56 
60 class FXAPI FXErrorException : public FXException {
61 private:
62  static const FXchar exceptionName[];
63 public:
64  FXErrorException():FXException(FXErrorException::exceptionName){}
65  FXErrorException(const FXchar *msg):FXException(msg){}
66  };
67 
68 
72 class FXAPI FXRangeException : public FXErrorException {
73 private:
74  static const FXchar exceptionName[];
75 public:
76  FXRangeException():FXErrorException(FXRangeException::exceptionName){}
77  FXRangeException(const FXchar *msg):FXErrorException(msg){}
78  };
79 
80 
84 class FXAPI FXPointerException : public FXErrorException {
85 private:
86  static const FXchar exceptionName[];
87 public:
88  FXPointerException():FXErrorException(FXPointerException::exceptionName){}
89  FXPointerException(const FXchar *msg):FXErrorException(msg){}
90  };
91 
92 
96 class FXAPI FXResourceException : public FXException {
97 private:
98  static const FXchar exceptionName[];
99 public:
100  FXResourceException():FXException(FXResourceException::exceptionName){}
101  FXResourceException(const FXchar *msg):FXException(msg){}
102  };
103 
104 
109 private:
110  static const FXchar exceptionName[];
111 public:
112  FXMemoryException():FXResourceException(FXMemoryException::exceptionName){}
113  FXMemoryException(const FXchar *msg):FXResourceException(msg){}
114  };
115 
116 
121 private:
122  static const FXchar exceptionName[];
123 public:
124  FXWindowException():FXResourceException(FXWindowException::exceptionName){}
125  FXWindowException(const FXchar *msg):FXResourceException(msg){}
126  };
127 
128 
132 class FXAPI FXImageException : public FXResourceException {
133 private:
134  static const FXchar exceptionName[];
135 public:
136  FXImageException():FXResourceException(FXImageException::exceptionName){}
137  FXImageException(const FXchar *msg):FXResourceException(msg){}
138  };
139 
140 
144 class FXAPI FXFontException : public FXResourceException {
145 private:
146  static const FXchar exceptionName[];
147 public:
148  FXFontException():FXResourceException(FXFontException::exceptionName){}
149  FXFontException(const FXchar *msg):FXResourceException(msg){}
150  };
151 
152 
158 class FXAPI FXThreadException : public FXException {
159 private:
160  FXint exitcode;
161 private:
162  static const FXchar exceptionName[];
163 public:
164  FXThreadException(FXint xc=-1):FXException(FXThreadException::exceptionName),exitcode(xc){}
165  FXThreadException(const FXchar *msg,FXint xc=-1):FXException(msg),exitcode(xc){}
166  FXint code() const { return exitcode; }
167  };
168 
169 }
170 
171 #endif
Generic catch-all exception.
Definition: FXException.h:32
Window exception.
Definition: FXException.h:120
Throw this exception to terminate the calling thread gracefully, and pass the given return code back ...
Definition: FXException.h:158
Fatal error exception.
Definition: FXException.h:48
Index out of range.
Definition: FXException.h:72
Invalid pointer.
Definition: FXException.h:84
Definition: FX4Splitter.h:28
Image, cursor, bitmap exception.
Definition: FXException.h:132
Font exception.
Definition: FXException.h:144
Generic error exception.
Definition: FXException.h:60
Generic resource exception.
Definition: FXException.h:96
Out of memory.
Definition: FXException.h:108

Copyright © 1997-2022 Jeroen van der Zijp