libpcidsk
Public Member Functions
PCIDSK::PCIDSKException Class Reference

Generic SDK Exception. More...

List of all members.

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.

Detailed Description

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 );
    }

Constructor & Destructor Documentation

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.

Parameters:
fmtthe printf style format (eg. "Illegal value:%d")
...additional arguments as required by the format string.

References vPrintf().

PCIDSKException::~PCIDSKException ( ) throw () [virtual]

Destructor.


Member Function Documentation

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().

Parameters:
fmtprintf style format string.
argsadditional arguments as required.

Referenced by PCIDSKException(), and PCIDSK::ThrowPCIDSKException().

const char * PCIDSKException::what ( ) const throw () [inline, virtual]

fetch exception message.

Returns:
a pointer to the internal message associated with the exception.

The documentation for this class was generated from the following files:

Generated for GDAL by doxygen 1.7.6.1.