00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _CEGUIExceptions_h_
00031 #define _CEGUIExceptions_h_
00032
00034
00036
00037 #include "CEGUIBase.h"
00038 #include "CEGUIString.h"
00039
00041
00043
00044
00045 namespace CEGUI
00046 {
00048
00050
00055 class CEGUIEXPORT Exception
00056 {
00057
00058 public:
00059
00060
00061
00066 virtual ~Exception(void);
00067
00068
00069
00070
00071
00079 const String& getMessage(void) const {return d_message;}
00080
00088 const String& getName() const { return d_name; }
00089
00097 const String& getFileName(void) const {return d_filename;}
00098
00106 const int getLine(void) const {return d_line;}
00107
00108 protected:
00109
00110
00111
00112
00113
00131 Exception(const String& message = "", const String& name ="CEGUI::Exception", const String& filename = "", int line = 0);
00132
00133
00134
00135
00136
00141 String d_message;
00142
00147 String d_filename;
00148
00153 String d_name;
00154
00159 int d_line;
00160 };
00161
00163
00165
00170 class CEGUIEXPORT GenericException : public Exception
00171 {
00172 public:
00173
00174
00175
00176
00177
00196 GenericException(const String& message, const String& file = "unknown", int line = 0)
00197 : Exception(message, "CEGUI::GenericException", file, line) {}
00198 };
00199
00216 #define GenericException(message) \
00217 GenericException(message, __FILE__, __LINE__)
00218
00220
00222
00227 class CEGUIEXPORT UnknownObjectException : public Exception
00228 {
00229 public:
00230
00231
00232
00233
00234
00253 UnknownObjectException(const String& message, const String& file = "unknown", int line = 0)
00254 : Exception(message, "CEGUI::UnknownObjectException", file, line) {}
00255 };
00256
00273 #define UnknownObjectException(message) \
00274 UnknownObjectException(message, __FILE__, __LINE__)
00275
00277
00279
00284 class CEGUIEXPORT InvalidRequestException : public Exception
00285 {
00286 public:
00287
00288
00289
00290
00291
00310 InvalidRequestException(const String& message, const String& file = "unknown", int line = 0)
00311 : Exception(message, "CEGUI::InvalidRequestException", file, line) {}
00312 };
00313
00330 #define InvalidRequestException(message) \
00331 InvalidRequestException(message, __FILE__, __LINE__)
00332
00334
00336
00341 class CEGUIEXPORT FileIOException : public Exception
00342 {
00343 public:
00344
00345
00346
00347
00348
00367 FileIOException(const String& message, const String& file = "unknown", int line = 0)
00368 : Exception(message, "CEGUI::FileIOException", file, line) {}
00369 };
00370
00387 #define FileIOException(message) \
00388 FileIOException(message, __FILE__, __LINE__)
00389
00391
00393
00398 class CEGUIEXPORT RendererException : public Exception
00399 {
00400 public:
00401
00402
00403
00404
00405
00424 RendererException(const String& message, const String& file = "unknown", int line = 0)
00425 : Exception(message, "CEGUI::RendererException", file, line) {}
00426 };
00427
00444 #define RendererException(message) \
00445 RendererException(message, __FILE__, __LINE__)
00446
00448
00450
00455 class CEGUIEXPORT AlreadyExistsException : public Exception
00456 {
00457 public:
00458
00459
00460
00461
00462
00481 AlreadyExistsException(const String& message, const String& file = "unknown", int line = 0)
00482 : Exception(message, "CEGUI::AlreadyExistsException", file, line) {}
00483 };
00484
00501 #define AlreadyExistsException(message) \
00502 AlreadyExistsException(message, __FILE__, __LINE__)
00503
00505
00507
00512 class CEGUIEXPORT MemoryException : public Exception
00513 {
00514 public:
00515
00516
00517
00518
00519
00538 MemoryException(const String& message, const String& file = "unknown", int line = 0)
00539 : Exception(message, "CEGUI::MemoryException", file, line) {}
00540 };
00541
00558 #define MemoryException(message) \
00559 MemoryException(message, __FILE__, __LINE__)
00560
00562
00564
00569 class CEGUIEXPORT NullObjectException : public Exception
00570 {
00571 public:
00572
00573
00574
00575
00576
00595 NullObjectException(const String& message, const String& file = "unknown", int line = 0)
00596 : Exception(message, "CEGUI::NullObjectException", file, line) {}
00597 };
00598
00615 #define NullObjectException(message) \
00616 NullObjectException(message, __FILE__, __LINE__)
00617
00619
00621
00626 class CEGUIEXPORT ObjectInUseException : public Exception
00627 {
00628 public:
00629
00630
00631
00632
00633
00652 ObjectInUseException(const String& message, const String& file = "unknown", int line = 0)
00653 : Exception(message, "CEGUI::ObjectInUseException", file, line) {}
00654 };
00655
00672 #define ObjectInUseException(message) \
00673 ObjectInUseException(message, __FILE__, __LINE__)
00674
00676
00678
00683 class CEGUIEXPORT ScriptException : public Exception
00684 {
00685 public:
00686
00687
00688
00689
00690
00709 ScriptException(const String& message, const String& file = "unknown", int line = 0)
00710 : Exception(message, "CEGUI::ScriptException", file, line) {}
00711 };
00712
00729 #define ScriptException(message) \
00730 ScriptException(message, __FILE__, __LINE__)
00731
00732
00733 }
00734
00735
00736 #endif // end of guard _CEGUIExceptions_h_