00001 /*********************************************************************** 00002 filename: CEGUIExceptions.h 00003 created: 20/2/2004 00004 author: Paul D Turner 00005 00006 purpose: Defines exceptions used within the system 00007 *************************************************************************/ 00008 /*************************************************************************** 00009 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining 00012 * a copy of this software and associated documentation files (the 00013 * "Software"), to deal in the Software without restriction, including 00014 * without limitation the rights to use, copy, modify, merge, publish, 00015 * distribute, sublicense, and/or sell copies of the Software, and to 00016 * permit persons to whom the Software is furnished to do so, subject to 00017 * the following conditions: 00018 * 00019 * The above copyright notice and this permission notice shall be 00020 * included in all copies or substantial portions of the Software. 00021 * 00022 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00023 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00024 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00025 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00026 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00027 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00028 * OTHER DEALINGS IN THE SOFTWARE. 00029 ***************************************************************************/ 00030 #ifndef _CEGUIExceptions_h_ 00031 #define _CEGUIExceptions_h_ 00032 00033 #include "CEGUIBase.h" 00034 #include "CEGUIString.h" 00035 00036 00037 // Start of CEGUI namespace section 00038 namespace CEGUI 00039 { 00044 class CEGUIEXPORT Exception 00045 { 00046 public: 00047 /************************************************************************* 00048 Construction and Destruction 00049 *************************************************************************/ 00050 Exception(const String& message); 00051 virtual ~Exception(void); 00052 00060 const String& getMessage(void) const {return d_message;} 00061 00062 00063 protected: 00064 String d_message; 00065 }; 00066 00071 class CEGUIEXPORT GenericException : public Exception 00072 { 00073 public: 00074 /************************************************************************* 00075 Construction and Destruction 00076 *************************************************************************/ 00077 GenericException(const String& message) : Exception(message) {} 00078 }; 00079 00084 class CEGUIEXPORT UnknownObjectException : public Exception 00085 { 00086 public: 00087 /************************************************************************* 00088 Construction and Destruction 00089 *************************************************************************/ 00090 UnknownObjectException(const String& message) : Exception(message) {} 00091 }; 00092 00097 class CEGUIEXPORT InvalidRequestException : public Exception 00098 { 00099 public: 00100 /************************************************************************* 00101 Construction and Destruction 00102 *************************************************************************/ 00103 InvalidRequestException(const String& message) : Exception(message) {} 00104 }; 00105 00110 class CEGUIEXPORT FileIOException : public Exception 00111 { 00112 public: 00113 /************************************************************************* 00114 Construction and Destruction 00115 *************************************************************************/ 00116 FileIOException(const String& message) : Exception(message) {} 00117 }; 00118 00123 class CEGUIEXPORT RendererException : public Exception 00124 { 00125 public: 00126 /************************************************************************* 00127 Construction and Destruction 00128 *************************************************************************/ 00129 RendererException(const String& message) : Exception(message) {} 00130 }; 00131 00136 class CEGUIEXPORT AlreadyExistsException : public Exception 00137 { 00138 public: 00139 /************************************************************************* 00140 Construction and Destruction 00141 *************************************************************************/ 00142 AlreadyExistsException(const String& message) : Exception(message) {} 00143 }; 00144 00149 class CEGUIEXPORT MemoryException : public Exception 00150 { 00151 public: 00152 /************************************************************************* 00153 Construction and Destruction 00154 *************************************************************************/ 00155 MemoryException(const String& message) : Exception(message) {} 00156 }; 00157 00162 class CEGUIEXPORT NullObjectException : public Exception 00163 { 00164 public: 00165 /************************************************************************* 00166 Construction and Destruction 00167 *************************************************************************/ 00168 NullObjectException(const String& message) : Exception(message) {} 00169 }; 00170 00175 class CEGUIEXPORT ObjectInUseException : public Exception 00176 { 00177 public: 00178 /************************************************************************* 00179 Construction and Destruction 00180 *************************************************************************/ 00181 ObjectInUseException(const String& message) : Exception(message) {} 00182 }; 00183 00188 class CEGUIEXPORT ScriptException : public Exception 00189 { 00190 public: 00191 /************************************************************************* 00192 Construction and Destruction 00193 *************************************************************************/ 00194 ScriptException(const String& message) : Exception(message) {} 00195 }; 00196 00197 00198 } // End of CEGUI namespace section 00199 00200 00201 #endif // end of guard _CEGUIExceptions_h_