www/api/Magick++/Exception_8h_source.html
| Magick++ 7.1.0 |
Exception.h
Go to the documentation of this file.
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
4 //
5 // Copyright @ 2014 ImageMagick Studio LLC, a non-profit organization
6 // dedicated to making software imaging solutions freely available.
7 //
8 // Definition of Magick::Exception and derived classes
9 // Magick::Warning* and Magick::Error*. Derived from C++ STD
10 // 'exception' class for convenience.
11 //
12 // These classes form part of the Magick++ user interface.
13 //
14
15 #if !defined(Magick_Exception_header)
16 #define Magick_Exception_header
17
18 #include "Magick++/Include.h"
19 #include <string>
20 #include <exception>
21
22 namespace Magick
23 {
24class MagickPPExport Exception: public std::exception
25 {
26public:
27
28// Construct with message string
29Exception(const std::string& what_);
30
31// Construct with message string and nested exception
32Exception(const std::string& what_, Exception* nested_);
33
34// Copy constructor
35Exception(const Exception& original_);
36
37// Destructor
38virtual ~Exception() throw();
39
40// Assignment operator
41Exception& operator=(const Exception& original_);
42
43// Get string identifying exception
44virtual const char* what() const throw();
45
46// Get nested exception
47const Exception* nested() const throw();
48
50//
51// No user-serviceable parts beyond this point
52//
54
55void nested(Exception* nested_) throw();
56
57private:
58 std::string _what;
59Exception* _nested;
60 };
61
62//
63// Error exceptions
64//
65
66class MagickPPExport Error: public Exception
67 {
68public:
69explicit Error(const std::string& what_);
70explicit Error(const std::string& what_,Exception *nested_);
71 ~Error() throw();
72 };
73
74class MagickPPExport ErrorBlob: public Error
75 {
76public:
77explicit ErrorBlob(const std::string& what_);
78explicit ErrorBlob(const std::string& what_,Exception *nested_);
79 ~ErrorBlob() throw();
80 };
81
82class MagickPPExport ErrorCache: public Error
83 {
84public:
85explicit ErrorCache(const std::string& what_);
86explicit ErrorCache(const std::string& what_,Exception *nested_);
87 ~ErrorCache() throw();
88 };
89
90class MagickPPExport ErrorCoder: public Error
91 {
92public:
93explicit ErrorCoder(const std::string& what_);
94explicit ErrorCoder(const std::string& what_,Exception *nested_);
95 ~ErrorCoder() throw();
96 };
97
98class MagickPPExport ErrorConfigure: public Error
99 {
100public:
101explicit ErrorConfigure(const std::string& what_);
102explicit ErrorConfigure(const std::string& what_,Exception *nested_);
103 ~ErrorConfigure() throw();
104 };
105
106class MagickPPExport ErrorCorruptImage: public Error
107 {
108public:
109explicit ErrorCorruptImage(const std::string& what_);
110explicit ErrorCorruptImage(const std::string& what_,Exception *nested_);
111 ~ErrorCorruptImage() throw();
112 };
113
114class MagickPPExport ErrorDelegate: public Error
115 {
116public:
117explicit ErrorDelegate(const std::string& what_);
118explicit ErrorDelegate(const std::string& what_,Exception *nested_);
119 ~ErrorDelegate() throw();
120 };
121
122class MagickPPExport ErrorDraw: public Error
123 {
124public:
125explicit ErrorDraw(const std::string& what_);
126explicit ErrorDraw(const std::string& what_,Exception *nested_);
127 ~ErrorDraw() throw();
128 };
129
130class MagickPPExport ErrorFileOpen: public Error
131 {
132public:
133explicit ErrorFileOpen(const std::string& what_);
134explicit ErrorFileOpen(const std::string& what_,Exception *nested_);
135 ~ErrorFileOpen() throw();
136 };
137
138class MagickPPExport ErrorImage: public Error
139 {
140public:
141explicit ErrorImage(const std::string& what_);
142explicit ErrorImage(const std::string& what_,Exception *nested_);
143 ~ErrorImage() throw();
144 };
145
146class MagickPPExport ErrorMissingDelegate: public Error
147 {
148public:
149explicit ErrorMissingDelegate(const std::string& what_);
150explicit ErrorMissingDelegate(const std::string& what_,Exception *nested_);
151 ~ErrorMissingDelegate() throw();
152 };
153
154class MagickPPExport ErrorModule: public Error
155 {
156public:
157explicit ErrorModule(const std::string& what_);
158explicit ErrorModule(const std::string& what_,Exception *nested_);
159 ~ErrorModule() throw();
160 };
161
162class MagickPPExport ErrorMonitor: public Error
163 {
164public:
165explicit ErrorMonitor(const std::string& what_);
166explicit ErrorMonitor(const std::string& what_,Exception *nested_);
167 ~ErrorMonitor() throw();
168 };
169
170class MagickPPExport ErrorOption: public Error
171 {
172public:
173explicit ErrorOption(const std::string& what_);
174explicit ErrorOption(const std::string& what_,Exception *nested_);
175 ~ErrorOption() throw();
176 };
177
178class MagickPPExport ErrorPolicy: public Error
179 {
180public:
181explicit ErrorPolicy(const std::string& what_);
182explicit ErrorPolicy(const std::string& what_,Exception *nested_);
183 ~ErrorPolicy() throw();
184 };
185
186class MagickPPExport ErrorRegistry: public Error
187 {
188public:
189explicit ErrorRegistry(const std::string& what_);
190explicit ErrorRegistry(const std::string& what_,Exception *nested_);
191 ~ErrorRegistry() throw();
192 };
193
194class MagickPPExport ErrorResourceLimit: public Error
195 {
196public:
197explicit ErrorResourceLimit(const std::string& what_);
198explicit ErrorResourceLimit(const std::string& what_,Exception *nested_);
199 ~ErrorResourceLimit() throw();
200 };
201
202class MagickPPExport ErrorStream: public Error
203 {
204public:
205explicit ErrorStream(const std::string& what_);
206explicit ErrorStream(const std::string& what_,Exception *nested_);
207 ~ErrorStream() throw();
208 };
209
210class MagickPPExport ErrorType: public Error
211 {
212public:
213explicit ErrorType(const std::string& what_);
214explicit ErrorType(const std::string& what_,Exception *nested_);
215 ~ErrorType() throw();
216 };
217
218class MagickPPExport ErrorUndefined: public Error
219 {
220public:
221explicit ErrorUndefined(const std::string& what_);
222explicit ErrorUndefined(const std::string& what_,Exception *nested_);
223 ~ErrorUndefined() throw();
224 };
225
226class MagickPPExport ErrorXServer: public Error
227 {
228public:
229explicit ErrorXServer(const std::string& what_);
230explicit ErrorXServer(const std::string& what_,Exception *nested_);
231 ~ErrorXServer() throw();
232 };
233
234//
235// Warnings
236//
237
238class MagickPPExport Warning: public Exception
239 {
240public:
241explicit Warning(const std::string& what_);
242explicit Warning(const std::string& what_,Exception *nested_);
243 ~Warning() throw();
244 };
245
246class MagickPPExport WarningBlob: public Warning
247 {
248public:
249explicit WarningBlob(const std::string& what_);
250explicit WarningBlob(const std::string& what_,Exception *nested_);
251 ~WarningBlob() throw();
252 };
253
254class MagickPPExport WarningCache: public Warning
255 {
256public:
257explicit WarningCache(const std::string& what_);
258explicit WarningCache(const std::string& what_,Exception *nested_);
259 ~WarningCache() throw();
260 };
261
262class MagickPPExport WarningCoder: public Warning
263 {
264public:
265explicit WarningCoder(const std::string& what_);
266explicit WarningCoder(const std::string& what_,Exception *nested_);
267 ~WarningCoder() throw();
268 };
269
270class MagickPPExport WarningConfigure: public Warning
271 {
272public:
273explicit WarningConfigure(const std::string& what_);
274explicit WarningConfigure(const std::string& what_,Exception *nested_);
275 ~WarningConfigure() throw();
276 };
277
278class MagickPPExport WarningCorruptImage: public Warning
279 {
280public:
281explicit WarningCorruptImage(const std::string& what_);
282explicit WarningCorruptImage(const std::string& what_,Exception *nested_);
283 ~WarningCorruptImage() throw();
284 };
285
286class MagickPPExport WarningDelegate: public Warning
287 {
288public:
289explicit WarningDelegate(const std::string& what_);
290explicit WarningDelegate(const std::string& what_,Exception *nested_);
291 ~WarningDelegate() throw();
292 };
293
294class MagickPPExport WarningDraw : public Warning
295 {
296public:
297explicit WarningDraw(const std::string& what_);
298explicit WarningDraw(const std::string& what_,Exception *nested_);
299 ~WarningDraw() throw();
300 };
301
302class MagickPPExport WarningFileOpen: public Warning
303 {
304public:
305explicit WarningFileOpen(const std::string& what_);
306explicit WarningFileOpen(const std::string& what_,Exception *nested_);
307 ~WarningFileOpen() throw();
308 };
309
310class MagickPPExport WarningImage: public Warning
311 {
312public:
313explicit WarningImage(const std::string& what_);
314explicit WarningImage(const std::string& what_,Exception *nested_);
315 ~WarningImage() throw();
316 };
317
318class MagickPPExport WarningMissingDelegate: public Warning
319 {
320public:
321explicit WarningMissingDelegate(const std::string& what_);
322explicit WarningMissingDelegate(const std::string& what_,
323Exception *nested_);
324 ~WarningMissingDelegate() throw();
325 };
326
327class MagickPPExport WarningModule: public Warning
328 {
329public:
330explicit WarningModule(const std::string& what_);
331explicit WarningModule(const std::string& what_,Exception *nested_);
332 ~WarningModule() throw();
333 };
334
335class MagickPPExport WarningMonitor: public Warning
336 {
337public:
338explicit WarningMonitor(const std::string& what_);
339explicit WarningMonitor(const std::string& what_,Exception *nested_);
340 ~WarningMonitor() throw();
341 };
342
343class MagickPPExport WarningOption: public Warning
344 {
345public:
346explicit WarningOption(const std::string& what_);
347explicit WarningOption(const std::string& what_,Exception *nested_);
348 ~WarningOption() throw();
349 };
350
351class MagickPPExport WarningPolicy: public Warning
352 {
353public:
354explicit WarningPolicy(const std::string& what_);
355explicit WarningPolicy(const std::string& what_,Exception *nested_);
356 ~WarningPolicy() throw();
357 };
358
359class MagickPPExport WarningRegistry: public Warning
360 {
361public:
362explicit WarningRegistry(const std::string& what_);
363explicit WarningRegistry(const std::string& what_,Exception *nested_);
364 ~WarningRegistry() throw();
365 };
366
367class MagickPPExport WarningResourceLimit: public Warning
368 {
369public:
370explicit WarningResourceLimit(const std::string& what_);
371explicit WarningResourceLimit(const std::string& what_,Exception *nested_);
372 ~WarningResourceLimit() throw();
373 };
374
375class MagickPPExport WarningStream: public Warning
376 {
377public:
378explicit WarningStream(const std::string& what_);
379explicit WarningStream(const std::string& what_,Exception *nested_);
380 ~WarningStream() throw();
381 };
382
383class MagickPPExport WarningType: public Warning
384 {
385public:
386explicit WarningType(const std::string& what_);
387explicit WarningType(const std::string& what_,Exception *nested_);
388 ~WarningType() throw();
389 };
390
391class MagickPPExport WarningUndefined: public Warning
392 {
393public:
394explicit WarningUndefined(const std::string& what_);
395explicit WarningUndefined(const std::string& what_,Exception *nested_);
396 ~WarningUndefined() throw();
397 };
398
399class MagickPPExport WarningXServer: public Warning
400 {
401public:
402explicit WarningXServer(const std::string& what_);
403explicit WarningXServer(const std::string& what_,Exception *nested_);
404 ~WarningXServer() throw();
405 };
406
407//
408// No user-serviceable components beyond this point.
409//
410
411 std::string formatExceptionMessage(
412const MagickCore::ExceptionInfo *exception_);
413
414Exception* createException(const MagickCore::ExceptionInfo *exception_);
415
416// Throw exception based on raw data
417extern MagickPPExport void throwExceptionExplicit(
418const MagickCore::ExceptionType severity_,const char* reason_,
419const char* description_=(char *) NULL);
420
421// Thow exception based on ImageMagick's ExceptionInfo
422extern MagickPPExport void throwException(
423 MagickCore::ExceptionInfo *exception_,const bool quiet_=false);
424
425 } // namespace Magick
426
427 #endif // Magick_Exception_header
Definition: Exception.h:302
Definition: Exception.h:262
Definition: Exception.h:138
Definition: Exception.h:359
Magick::WarningMissingDelegate
Definition: Exception.h:318
Definition: Exception.h:122
Definition: Exception.h:399
Definition: Exception.h:66
Definition: Exception.h:114
Definition: Exception.h:162
Definition: Exception.h:130
Definition: Exception.h:170
Definition: Exception.h:98
Definition: Exception.h:391
Definition: Exception.h:335
Definition: Exception.h:351
Magick::formatExceptionMessage
std::string formatExceptionMessage(const MagickCore::ExceptionInfo *exception_)
Definition: Exception.cpp:687
MagickPPExport void throwException(MagickCore::ExceptionInfo *exception_, const bool quiet_=false)
Definition: Exception.h:74
Definition: Exception.h:343
Definition: Exception.h:246
Definition: Exception.h:194
Definition: Exception.h:186
Definition: Exception.h:106
Definition: Exception.h:226
#define MagickPPExport
Definition: Include.h:297
Definition: Exception.h:238
Definition: Exception.h:24
Definition: Exception.h:254
Definition: Exception.h:154
Definition: Exception.h:278
Magick::throwExceptionExplicit
MagickPPExport void throwExceptionExplicit(const MagickCore::ExceptionType severity_, const char *reason_, const char *description_=(char *) NULL)
Definition: Exception.cpp:808
Definition: Exception.h:367
Definition: Exception.h:178
Definition: Exception.h:383
Definition: Exception.h:90
Definition: Exception.h:146
Definition: Exception.h:310
Definition: Exception.h:286
Definition: Exception.h:210
Definition: Blob.h:17
Definition: Exception.h:270
Definition: Exception.h:327
Definition: Exception.h:202
Definition: Exception.h:218
Exception * createException(const MagickCore::ExceptionInfo *exception_)
Definition: Exception.cpp:702
Definition: Exception.h:82
Definition: Exception.h:294
Definition: Exception.h:375