Public Member Functions |
|
PException () | |
default constructor |
|
PException (const PException &p) | |
copy constructor |
|
PException (char *_message) | |
constructor with message |
|
PException (char *_message, PException &p) | |
constructor with message and another exception |
|
PException (bool formatted, char *_message,...) | |
constructor with format string |
|
~PException () | |
destructor |
|
PException & | operator= (const PException &p) |
assignment operator |
|
Public Attributes |
|
char * | message |
the exception error message |
This is the class all Poslib functions will use when they want to notify the caller in case of an error. It has only one member, message, which is a free-form message describing the error. It can be constructed in various ways: by specifying a message, a format string with arguments, and a combination of a message and an other exception.
Definition at line 40 of file exception.h.
|
default constructor This default constructor for the exception class sets the message to "". |
|
copy constructor This destructor makes a copy of another PException.
|
|
constructor with message This constructor takes the message to store in the PException. The message parameter will be copied to the PException using a strdup().
|
|
constructor with message and another exception This constructor takes a message, and another PException. The message variable will consists of the _message parameter and the message of the p parameter. This can be really convenient if you want to re-throw an exception, for example:
try { domainname x = "www.acdam.net"; (...) } catch (PException p) { throw PException("Process failed: ", p); }
|
|
constructor with format string This constructor can be used for formatting an error message. The first boolean parameter is only there so that this can be distinguished from other constructors; it has no actual meaning currently (we are thinking what meaning we could give it though - so stay tuned :) ). This code internally calls vsnprintf, so you don't need to bother about buffer overflows. Do note that the message will be trimmed of at 1024 characters if it becomes too long.
|
|
destructor This destructor frees all memory associated with the exception object. |
|
assignment operator This function assigns the message from the PException p to this object.
|
|
the exception error message The error message of the exception. This is just one piece of free-form text. You can always assume this value is non-NULL. Definition at line 118 of file exception.h. |