LCOV - code coverage report
Current view: top level - frmts/pcidsk/sdk - pcidsk_exception.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 2 2 100.0 %
Date: 2024-11-25 13:07:18 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Purpose:  Declaration of the PCIDSKException class. All exceptions thrown
       4             :  *           by the PCIDSK library will be of this type.
       5             :  *
       6             :  ******************************************************************************
       7             :  * Copyright (c) 2009
       8             :  * PCI Geomatics, 90 Allstate Parkway, Markham, Ontario, Canada.
       9             :  *
      10             :  * SPDX-License-Identifier: MIT
      11             :  ****************************************************************************/
      12             : #ifndef INCLUDE_PCIDSK_EXCEPTION_H
      13             : #define INCLUDE_PCIDSK_EXCEPTION_H
      14             : 
      15             : #include "pcidsk_config.h"
      16             : 
      17             : #include <string>
      18             : #include <cstdarg>
      19             : #include <stdexcept>
      20             : 
      21             : namespace PCIDSK
      22             : {
      23             : /************************************************************************/
      24             : /*                              Exception                               */
      25             : /************************************************************************/
      26             : 
      27             :     class PCIDSK_DLL PCIDSKException : public std::exception
      28             :     {
      29             :         friend void PCIDSK_DLL ThrowPCIDSKException( const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(1,2);
      30             :         friend int PCIDSK_DLL ThrowPCIDSKException( int ret_unused, const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(2,3);
      31             :         friend void PCIDSK_DLL * ThrowPCIDSKExceptionPtr( const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(1,2);
      32          56 :         PCIDSKException() {}
      33             :     public:
      34             :         PCIDSKException(const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(2,3);
      35             :         virtual ~PCIDSKException() throw();
      36             : 
      37             :         void vPrintf( const char *fmt, std::va_list list );
      38          53 :         virtual const char *what() const throw() override { return message.c_str(); }
      39             :     private:
      40             :         std::string   message;
      41             :     };
      42             : 
      43             :     void PCIDSK_DLL ThrowPCIDSKException( const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(1,2);
      44             :     int PCIDSK_DLL ThrowPCIDSKException( int ret_unused, const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(2,3);
      45             :     void PCIDSK_DLL * ThrowPCIDSKExceptionPtr( const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(1,2);
      46             : 
      47             : } // end namespace PCIDSK
      48             : 
      49             : #endif // INCLUDE_PCIDSK_EXCEPTION_H

Generated by: LCOV version 1.14