libpcidsk
|
Generic SDK Exception. More...
Public Member Functions | |
PCIDSKException (const char *fmt,...) | |
virtual | ~PCIDSKException () throw () |
void | vPrintf (const char *fmt, va_list list) |
virtual const char * | what () const throw () |
fetch exception message. |
Generic SDK Exception.
The PCIDSKException class is used for all errors thrown by the PCIDSK library. It includes a formatted message and is derived from std::exception. The PCIDSK library throws all exceptions as pointers, and library exceptions should be caught like this:
try { PCIDSKFile *file = PCIDSK::Open( "irvine.pix, "r", NULL ); } catch( PCIDSK::PCIDSKException &ex ) { fprintf( stderr, "PCIDSKException:\n%s\n", ex.what() ); exit( 1 ); }
PCIDSKException::PCIDSKException | ( | const char * | fmt, |
... | |||
) |
Create exception with formatted message.
This constructor supports formatting of an exception message using printf style format and additional arguments.
fmt | the printf style format (eg. "Illegal value:%d") |
... | additional arguments as required by the format string. |
References vPrintf().
PCIDSKException::~PCIDSKException | ( | ) | throw () [virtual] |
Destructor.
void PCIDSKException::vPrintf | ( | const char * | fmt, |
va_list | args | ||
) |
Format a message.
Assigns a message to an exception using printf style formatting and va_list arguments (similar to vfprintf().
fmt | printf style format string. |
args | additional arguments as required. |
Referenced by PCIDSKException(), and PCIDSK::ThrowPCIDSKException().
const char * PCIDSKException::what | ( | ) | const throw () [inline, virtual] |
fetch exception message.