OLException Class Reference
[Exceptions]

This class is used to propagate information about exceptions. More...

#import <ObjectiveLib/Exception.h>

List of all members.

Public Member Functions

(const char *) - message
 Return the message associated with this exception.
(void) - raise
 Raise the exception.
(const char *) - type
 Return the type or name of the exception.
Initializers and Deallocatros
(id) - free
 Deallocate memory and free the exception.
(id) - initWithType:message:
 Initialize an exception.
(id) - initWithType:message:arguments:
 Initialize an exception.

Static Public Member Functions

(void) + raiseType:message:
 Raise an exception.
(void) + raiseTypeString:messageString:
 Raise an exception.

Protected Attributes

char * message
 The message to be delivered.
char * type
 The type or name of the exception.


Detailed Description

This class is used to propagate information about exceptions.


Member Function Documentation

- (id) free  

Deallocate memory and free the exception.

- (id) initWithType: (const char *)  nm
message: (const char *)  msg
,   ... 

Initialize an exception.

The exception is given the name and its message. This message musters the variadic arguments and sends the message initWithType:message:arguments:.

Parameters:
nm the name or type of the exception
msg the message to convey
... the variadic arguments to format into the message
Returns:
a reference to this exception

- (id) initWithType: (const char *)  nm
message: (const char *)  msg
arguments: (va_list)  args 

Initialize an exception.

The exception is given the name and its message. The message is formatted by inserting the arguments into the message using printf style formatting.

Parameters:
nm the name or type of the exception
msg the message to convey
args the variadic arguments to format into the message
Returns:
a reference to this exception

- (const char*) message  

Return the message associated with this exception.

Returns:
the message

- (void) raise  

Raise the exception.

The exception is raised and control is transferred to the next available block of code defined by OL_CATCH and OL_END_CATCH. If there is no catch block available, then the system will abort.

Precondition:
A block of code defined by OL_CATCH and OL_END_CATCH must exist somewhere in the call stack.

+ (void) raiseType: (const char *)  nm
message: (const char *)  msg
,   ... 

Raise an exception.

This is a convenience method for allocating, instantiating and rasing a new exception. See initWithType:message:arguments:.

Parameters:
nm the name or type of exception
msg the message that the exception should convey
... the arguments used to format the message

+ (void) raiseTypeString: (OLConstantString *)  nm
messageString: (OLConstantString *)  msg
,   ... 

Raise an exception.

This is a convenience method for allocating, instantiating and rasing a new exception. The method initializes the eception with initWithType:message:arguments: by converting nm and msg into c-style "strings".

Parameters:
nm the name or type of exception
msg the message that the exception should convey
... the arguments used to format the message

- (const char*) type  

Return the type or name of the exception.

Returns:
the type or name


Member Data Documentation

- (char*) message [protected]

The message to be delivered.

- (char*) type [protected]

The type or name of the exception.


The documentation for this class was generated from the following file:
ObjectiveLibGenerated Sun Apr 22 15:18:27 2007, © 2004-2007 Will Mason
SourceForge.net Logo