LCOV - code coverage report
Current view: top level - apps - gdalalg_raster_info.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 10 10 100.0 %
Date: 2025-01-18 12:42:00 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  gdal "raster info" subcommand
       5             :  * Author:   Even Rouault <even dot rouault at spatialys.com>
       6             :  *
       7             :  ******************************************************************************
       8             :  * Copyright (c) 2024, Even Rouault <even dot rouault at spatialys.com>
       9             :  *
      10             :  * SPDX-License-Identifier: MIT
      11             :  ****************************************************************************/
      12             : 
      13             : #ifndef GDALALG_RASTER_INFO_INCLUDED
      14             : #define GDALALG_RASTER_INFO_INCLUDED
      15             : 
      16             : #include "gdalalgorithm.h"
      17             : 
      18             : //! @cond Doxygen_Suppress
      19             : 
      20             : /************************************************************************/
      21             : /*                       GDALRasterInfoAlgorithm                        */
      22             : /************************************************************************/
      23             : 
      24             : class GDALRasterInfoAlgorithm final : public GDALAlgorithm
      25             : {
      26             :   public:
      27             :     static constexpr const char *NAME = "info";
      28             :     static constexpr const char *DESCRIPTION =
      29             :         "Return information on a raster dataset.";
      30             :     static constexpr const char *HELP_URL = "/programs/gdal_raster_info.html";
      31             : 
      32         168 :     static std::vector<std::string> GetAliases()
      33             :     {
      34         168 :         return {};
      35             :     }
      36             : 
      37             :     explicit GDALRasterInfoAlgorithm(bool openForMixedRasterVector = false);
      38             : 
      39          20 :     GDALDataset *GetDatasetRef()
      40             :     {
      41          20 :         return m_dataset.GetDatasetRef();
      42             :     }
      43             : 
      44           1 :     void SetDataset(GDALDataset *poDS)
      45             :     {
      46           1 :         auto arg = GetArg(GDAL_ARG_NAME_INPUT);
      47           1 :         if (arg)
      48             :         {
      49           1 :             arg->Set(poDS);
      50           1 :             arg->SetSkipIfAlreadySet();
      51             :         }
      52           1 :     }
      53             : 
      54             :   private:
      55             :     bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override;
      56             : 
      57             :     std::string m_format{};
      58             :     bool m_minMax = false;
      59             :     bool m_stats = false;
      60             :     bool m_approxStats = false;
      61             :     bool m_hist = false;
      62             :     bool m_noGCP = false;
      63             :     bool m_noMD = false;
      64             :     bool m_noCT = false;
      65             :     bool m_noFL = false;
      66             :     bool m_noMask = false;
      67             :     bool m_noNodata = false;
      68             :     bool m_checksum = false;
      69             :     bool m_listMDD = false;
      70             :     bool m_stdout = false;
      71             :     std::string m_mdd{};
      72             :     int m_subDS = 0;
      73             :     GDALArgDatasetValue m_dataset{};
      74             :     std::vector<std::string> m_openOptions{};
      75             :     std::vector<std::string> m_inputFormats{};
      76             :     std::string m_output{};
      77             : };
      78             : 
      79             : //! @endcond
      80             : 
      81             : #endif

Generated by: LCOV version 1.14