class Exception

An exception class. More...

Definition#include <Exception.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Private Methods

Private Members


Detailed Description

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:
filethe source file the exception was thrown in.
linethe line in the source file.
descriptiontextual description of the exception.
codenumerical 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:
descriptiontextual description of the exception.
codenumerical 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:
filethe source file the exception was thrown in.
linethe line in the source file.
descriptiontextual description of the exception.
codenumerical 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:
filethe source file the exception was thrown in.
linethe line in the source file.
description1textual description of the exception part 1.
description2textual description of the exception part 2.
codenumerical 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:
filethe source file the exception was thrown in.
linethe line in the source file.
description1textual description of the exception part 1.
description2textual description of the exception part 2.
description3textual description of the exception part 3.
codenumerical error code.

inline  ~Exception ( void )
throw ()

~Exception

Desctructor.

inline Exception &  operator= ( const Exception & e )
throw ()

operator=

Assignment operator.

Parameters:
ethe 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.