|
|
An exception class.
This class should not depend on any other class should not throw any exceptions itself.
Typical usage:
throw Exception( __FILE__, __LINE__, "describe the exception", code); |
char * file | file |
[private]
unsigned int line | line |
[private]
char * description | description |
[private]
int code | code |
[private]
void
init ( const char * file,
unsigned int line,
const char * description,
int code )
throw () | init |
[private]
Initalize the object.
Parameters:
file | the source file the exception was thrown in. |
line | the line in the source file. |
description | textual description of the exception. |
code | numerical error code. |
void
strip ()
throw () | strip |
[private]
De-initalize the object.
inline
Exception ( void )
throw () | Exception |
Default constructor.
inline
Exception ( const Exception & e )
throw () | Exception |
Copy constructor.
inline
Exception ( const char * description,
int code = 0 )
throw () | Exception |
Construct by a description and error code.
Parameters:
description | textual description of the exception. |
code | numerical error code. |
inline
Exception ( const char * file,
unsigned int line,
const char * description = 0,
int code = 0 )
throw () | Exception |
Construct by source file information, a description and error code.
Parameters:
file | the source file the exception was thrown in. |
line | the line in the source file. |
description | textual description of the exception. |
code | numerical error code. |
Exception ( const char * file,
unsigned int line,
const char * description1,
const char * description2,
int code = 0 )
throw () | Exception |
Construct by source file information, a description and error code. The description is constructed from two strings, any of which may be NULL.
Parameters:
file | the source file the exception was thrown in. |
line | the line in the source file. |
description1 | textual description of the exception part 1. |
description2 | textual description of the exception part 2. |
code | numerical error code. |
Exception ( const char * file,
unsigned int line,
const char * description1,
const char * description2,
const char * description3,
int code = 0 )
throw () | Exception |
Construct by source file information, a description and error code. The description is constructed from three strings, any of which may be NULL.
Parameters:
file | the source file the exception was thrown in. |
line | the line in the source file. |
description1 | textual description of the exception part 1. |
description2 | textual description of the exception part 2. |
description3 | textual description of the exception part 3. |
code | numerical error code. |
inline
~Exception ( void )
throw () | ~Exception |
Desctructor.
inline Exception &
operator= ( const Exception & e )
throw () | operator= |
Assignment operator.
Parameters:
e | the Exception to assign this to. |
Returns: a reference to this Exception.
inline const char *
getDescription ( void )
throw () | getDescription |
[const]
Return the textual description of the Exception.
Returns: the textual description of the Exception.
inline unsigned int
getLine ( void )
throw () | getLine |
[const]
Return the line number in the source file this Exception was thrown in.
Returns: the line number in the source file this Exception was thrown in.
inline const char *
getFile ( void )
throw () | getFile |
[const]
Return the source file this Exception was thrown in.
Returns: the source file this Exception was thrown in.
inline int
getCode ( void )
throw () | getCode |
[const]
Return the numerical code of the Exception.
Returns: the numerical code of the Exception.