LCOV - code coverage report
Current view: top level - apps - gdalalg_mdim.cpp (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 14 14 100.0 %
Date: 2026-02-01 11:59:10 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_convert.h"
      19             : #include "gdalalg_mdim_mosaic.h"
      20             : 
      21             : #include "gdal_priv.h"
      22             : 
      23             : #ifndef _
      24             : #define _(x) (x)
      25             : #endif
      26             : 
      27             : /************************************************************************/
      28             : /*                          GDALMdimAlgorithm                           */
      29             : /************************************************************************/
      30             : 
      31          67 : GDALMdimAlgorithm::GDALMdimAlgorithm()
      32          67 :     : GDALAlgorithm(NAME, DESCRIPTION, HELP_URL)
      33             : {
      34             :     AddArg("drivers", 0,
      35             :            _("Display multidimensional driver list as JSON document"),
      36          67 :            &m_drivers);
      37             : 
      38          67 :     AddOutputStringArg(&m_output);
      39             : 
      40          67 :     RegisterSubAlgorithm<GDALMdimInfoAlgorithm>();
      41          67 :     RegisterSubAlgorithm<GDALMdimConvertAlgorithm>();
      42          67 :     RegisterSubAlgorithm<GDALMdimMosaicAlgorithm>();
      43          67 : }
      44             : 
      45           2 : bool GDALMdimAlgorithm::RunImpl(GDALProgressFunc, void *)
      46             : {
      47           2 :     if (m_drivers)
      48             :     {
      49           1 :         m_output = GDALPrintDriverList(GDAL_OF_MULTIDIM_RASTER, true);
      50           1 :         return true;
      51             :     }
      52             :     else
      53             :     {
      54           1 :         CPLError(CE_Failure, CPLE_AppDefined,
      55             :                  "The Run() method should not be called directly on the \"gdal "
      56             :                  "mdim\" program.");
      57           1 :         return false;
      58             :     }
      59             : }
      60             : 
      61             : //! @endcond

Generated by: LCOV version 1.14