29 #ifndef _CEGUIExceptions_h_
30 #define _CEGUIExceptions_h_
32 #include "CEGUI/Base.h"
33 #include "CEGUI/String.h"
37 # pragma warning(push)
38 # pragma warning(disable : 4275)
46 class CEGUIEXPORT Exception :
47 public std::exception,
48 public AllocatedObject<Exception>
52 virtual ~Exception(
void)
throw();
63 const String& getMessage(
void)
const
74 const String& getName()
const
86 const String& getFileName(
void)
const
87 {
return d_filename; }
96 int getLine(
void)
const
108 const String& getFunctionName(
void)
const
109 {
return d_function; }
112 const char* what()
const throw();
126 static
void setStdErrEnabled(
bool enabled);
135 static
bool isStdErrEnabled();
139 static
bool d_stdErrEnabled;
167 const
String& filename = "",
169 const
String& function = "");
217 const String& file =
"unknown",
int line = 0,
219 Exception(message,
"CEGUI::GenericException", file, line, function)
240 #define GenericException(message) \
241 GenericException(message, __FILE__, __LINE__, CEGUI_FUNCTION_NAME)
275 const String& file =
"unknown",
int line = 0,
276 const String&
function =
"unknown") :
277 Exception(message,
"CEGUI::UnknownObjectException", file, line,
function)
298 #define UnknownObjectException(message) \
299 UnknownObjectException(message, __FILE__, __LINE__, CEGUI_FUNCTION_NAME)
333 const String& file =
"unknown",
int line = 0,
334 const String&
function =
"unknown") :
335 Exception(message,
"CEGUI::InvalidRequestException", file, line, function)
356 #define InvalidRequestException(message) \
357 InvalidRequestException(message, __FILE__, __LINE__, CEGUI_FUNCTION_NAME)
362 class CEGUIEXPORT FileIOException :
public Exception
390 FileIOException(
const String& message,
391 const String& file =
"unknown",
int line = 0,
392 const String&
function =
"unknown") :
393 Exception(message,
"CEGUI::FileIOException", file, line, function)
414 #define FileIOException(message) \
415 FileIOException(message, __FILE__, __LINE__, CEGUI_FUNCTION_NAME)
420 class CEGUIEXPORT RendererException :
public Exception
448 RendererException(
const String& message,
449 const String& file =
"unknown",
int line = 0,
450 const String&
function =
"unknown") :
451 Exception(message,
"CEGUI::RendererException", file, line, function)
472 #define RendererException(message) \
473 ::CEGUI::RendererException(message, __FILE__, __LINE__, CEGUI_FUNCTION_NAME)
483 class CEGUIEXPORT AlreadyExistsException :
public Exception
511 AlreadyExistsException(
const String& message,
512 const String& file =
"unknown",
int line = 0,
513 const String&
function =
"unknown") :
514 Exception(message,
"CEGUI::AlreadyExistsException", file, line, function)
535 #define AlreadyExistsException(message) \
536 AlreadyExistsException(message, __FILE__, __LINE__, CEGUI_FUNCTION_NAME)
541 class CEGUIEXPORT MemoryException :
public Exception
569 MemoryException(
const String& message,
570 const String& file =
"unknown",
int line = 0,
571 const String&
function =
"unknown") :
572 Exception(message,
"CEGUI::MemoryException", file, line, function)
593 #define MemoryException(message) \
594 MemoryException(message, __FILE__, __LINE__, CEGUI_FUNCTION_NAME)
599 class CEGUIEXPORT NullObjectException :
public Exception
627 NullObjectException(
const String& message,
628 const String& file =
"unknown",
int line = 0,
629 const String&
function =
"unknown") :
630 Exception(message,
"CEGUI::NullObjectException", file, line, function)
651 #define NullObjectException(message) \
652 NullObjectException(message, __FILE__, __LINE__, CEGUI_FUNCTION_NAME)
661 class CEGUIEXPORT ObjectInUseException :
public Exception
689 ObjectInUseException(
const String& message,
690 const String& file =
"unknown",
int line = 0,
691 const String&
function =
"unknown") :
692 Exception(message,
"CEGUI::ObjectInUseException", file, line, function)
713 #define ObjectInUseException(message) \
714 ObjectInUseException(message, __FILE__, __LINE__, CEGUI_FUNCTION_NAME)
719 class CEGUIEXPORT ScriptException :
public Exception
747 ScriptException(
const String& message,
748 const String& file =
"unknown",
int line = 0,
749 const String&
function =
"unknown") :
750 Exception(message,
"CEGUI::ScriptException", file, line, function)
771 #define ScriptException(message) \
772 ScriptException(message, __FILE__, __LINE__, CEGUI_FUNCTION_NAME)
779 #if defined(_MSC_VER)
780 # pragma warning(pop)
783 #endif // end of guard _CEGUIExceptions_h_