Crazy Eddie's GUI System  0.8.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::Exception Class Reference

Root exception class used within the GUI system. More...

Inherits exception, and CEGUI::AllocatedObject< Exception >.

Inherited by CEGUI::AlreadyExistsException, CEGUI::FileIOException, CEGUI::GenericException, CEGUI::InvalidRequestException, CEGUI::MemoryException, CEGUI::NullObjectException, CEGUI::ObjectInUseException, CEGUI::RendererException, CEGUI::ScriptException, and CEGUI::UnknownObjectException.

+ Collaboration diagram for CEGUI::Exception:

Public Member Functions

virtual ~Exception (void) throw ()
 Virtual destructor.
 
const StringgetMessage (void) const
 Return a reference to the String object describing the reason for the exception being thrown. More...
 
const StringgetName () const
 Return a reference to the String object containing the exception name (i.e. class type). More...
 
const StringgetFileName (void) const
 Return a reference to the String object containing the name of the file where the exception occurred. More...
 
int getLine (void) const
 Return the line number where the exception occurred. More...
 
const StringgetFunctionName (void) const
 Return a reference to the String object containing the name of the function where the exception occurred. More...
 
const char * what () const throw ()
 

Static Public Member Functions

static void setStdErrEnabled (bool enabled)
 Sets whether every exception construction should output to stderr. More...
 
static bool isStdErrEnabled ()
 Checks whether newly constructed exceptions will output to stderr. More...
 

Protected Member Functions

 Exception (const String &message="", const String &name="CEGUI::Exception", const String &filename="", int line=0, const String &function="")
 Protected constructor that prevents instantiations (users should employ derived exception classes instead) and that is responsible for logging the exception. More...
 

Protected Attributes

String d_message
 Holds the reason for the exception being thrown.
 
String d_name
 Holds the class name of the exception (e.g. CEGUI::ObjectInUseException)
 
String d_filename
 Holds the name of the file where the exception occurred.
 
int d_line
 Holds the line number where the exception occurred.
 
String d_function
 Holds the name of the function where the exception occurred.
 
String d_what
 Holds the default error message.
 

Static Protected Attributes

static bool d_stdErrEnabled
 if this is true, newly constructed exceptions will output to stderr
 

Detailed Description

Root exception class used within the GUI system.

Constructor & Destructor Documentation

CEGUI::Exception::Exception ( const String message = "",
const String name = "CEGUI::Exception",
const String filename = "",
int  line = 0,
const String function = "" 
)
protected

Protected constructor that prevents instantiations (users should employ derived exception classes instead) and that is responsible for logging the exception.

Parameters
messageString object describing the reason for the exception being thrown.
nameString object describing the exception class name (e.g. CEGUI::UnknownObjectException)
filenameString object containing the name of the file where the exception occurred.
lineInteger representing the line number where the exception occurred.
functionString object containing the name of the function where the exception occurred.

Member Function Documentation

const String& CEGUI::Exception::getFileName ( void  ) const
inline

Return a reference to the String object containing the name of the file where the exception occurred.

Returns
String object containing the name of the file where the exception occurred.
const String& CEGUI::Exception::getFunctionName ( void  ) const
inline

Return a reference to the String object containing the name of the function where the exception occurred.

Returns
String object containing the name of the function where the exception occurred.
int CEGUI::Exception::getLine ( void  ) const
inline

Return the line number where the exception occurred.

Integer representing the line number where the exception occurred.

const String& CEGUI::Exception::getMessage ( void  ) const
inline

Return a reference to the String object describing the reason for the exception being thrown.

Returns
String object containing a message describing the reason for the exception.
const String& CEGUI::Exception::getName ( void  ) const
inline

Return a reference to the String object containing the exception name (i.e. class type).

Returns
String object containing the exception name.
static bool CEGUI::Exception::isStdErrEnabled ( )
static

Checks whether newly constructed exceptions will output to stderr.

See Also
Exception::setStdErrEnabled
static void CEGUI::Exception::setStdErrEnabled ( bool  enabled)
static

Sets whether every exception construction should output to stderr.

Note
The default is true, all constructed exceptions output to stderr

You should only set it to false if you: 1) Know where your log is 2) Know what the log is for 3) Know how to use the info that's in the log