LCOV - code coverage report
Current view: top level - apps - gdalalg_mdim.cpp (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 17 17 100.0 %
Date: 2026-06-23 16:35:19 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  gdal "mdim" 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             : //! @cond Doxygen_Suppress
      14             : 
      15             : #include "gdalalg_mdim.h"
      16             : 
      17             : #include "gdalalg_mdim_info.h"
      18             : #include "gdalalg_mdim_compare.h"
      19             : #include "gdalalg_mdim_convert.h"
      20             : #include "gdalalg_mdim_mosaic.h"
      21             : #include "gdalalg_mdim_pipeline.h"
      22             : #include "gdalalg_mdim_reproject.h"
      23             : 
      24             : #include "gdal_priv.h"
      25             : 
      26             : #ifndef _
      27             : #define _(x) (x)
      28             : #endif
      29             : 
      30             : /************************************************************************/
      31             : /*                          GDALMdimAlgorithm                           */
      32             : /************************************************************************/
      33             : 
      34         141 : GDALMdimAlgorithm::GDALMdimAlgorithm()
      35         141 :     : GDALAlgorithm(NAME, DESCRIPTION, HELP_URL)
      36             : {
      37             :     AddArg("drivers", 0,
      38             :            _("Display multidimensional driver list as JSON document"),
      39         141 :            &m_drivers);
      40             : 
      41         141 :     AddOutputStringArg(&m_output);
      42             : 
      43         141 :     RegisterSubAlgorithm<GDALMdimInfoAlgorithmStandalone>();
      44         141 :     RegisterSubAlgorithm<GDALMdimCompareAlgorithmStandalone>();
      45         141 :     RegisterSubAlgorithm<GDALMdimConvertAlgorithm>();
      46         141 :     RegisterSubAlgorithm<GDALMdimMosaicAlgorithmStandalone>();
      47         141 :     RegisterSubAlgorithm<GDALMdimPipelineAlgorithm>();
      48         141 :     RegisterSubAlgorithm<GDALMdimReprojectAlgorithmStandalone>();
      49         141 : }
      50             : 
      51           2 : bool GDALMdimAlgorithm::RunImpl(GDALProgressFunc, void *)
      52             : {
      53           2 :     if (m_drivers)
      54             :     {
      55           1 :         m_output = GDALPrintDriverList(GDAL_OF_MULTIDIM_RASTER, true);
      56           1 :         return true;
      57             :     }
      58             :     else
      59             :     {
      60           1 :         CPLError(CE_Failure, CPLE_AppDefined,
      61             :                  "The Run() method should not be called directly on the \"gdal "
      62             :                  "mdim\" program.");
      63           1 :         return false;
      64             :     }
      65             : }
      66             : 
      67             : //! @endcond

Generated by: LCOV version 1.14