LCOV - code coverage report
Current view: top level - frmts/pcidsk/sdk - pcidsk_exception.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 4 4 100.0 %
Date: 2025-08-01 10:10:57 Functions: 4 5 80.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         112 :     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() = default;
      33             :     public:
      34             :         PCIDSKException(const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(2,3);
      35             :         virtual ~PCIDSKException();
      36             :         PCIDSKException(const PCIDSKException&) = default;
      37             :         PCIDSKException& operator=(const PCIDSKException&) = default;
      38          56 :         PCIDSKException(PCIDSKException&&) = default;
      39             :         PCIDSKException& operator=(PCIDSKException&&) = default;
      40             : 
      41             :         void vPrintf( const char *fmt, std::va_list list );
      42          53 :         virtual const char *what() const throw() override { return message.c_str(); }
      43             :     private:
      44             :         std::string   message;
      45             :     };
      46             : 
      47             :     void PCIDSK_DLL ThrowPCIDSKException( const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(1,2);
      48             :     int PCIDSK_DLL ThrowPCIDSKException( int ret_unused, const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(2,3);
      49             :     void PCIDSK_DLL * ThrowPCIDSKExceptionPtr( const char *fmt, ... ) PCIDSK_PRINT_FUNC_FORMAT(1,2);
      50             : 
      51             : } // end namespace PCIDSK
      52             : 
      53             : #endif // INCLUDE_PCIDSK_EXCEPTION_H

Generated by: LCOV version 1.14