LCOV - code coverage report
Current view: top level - apps - gdalalg_dataset.cpp (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 10 10 100.0 %
Date: 2025-06-19 12:30:01 Functions: 4 4 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  gdal "dataset" subcommand
       5             :  * Author:   Even Rouault <even dot rouault at spatialys.com>
       6             :  *
       7             :  ******************************************************************************
       8             :  * Copyright (c) 2025, Even Rouault <even dot rouault at spatialys.com>
       9             :  *
      10             :  * SPDX-License-Identifier: MIT
      11             :  ****************************************************************************/
      12             : 
      13             : #include "gdalalgorithm.h"
      14             : 
      15             : #include "gdalalg_dataset_identify.h"
      16             : #include "gdalalg_dataset_copy.h"
      17             : #include "gdalalg_dataset_rename.h"
      18             : #include "gdalalg_dataset_delete.h"
      19             : 
      20             : /************************************************************************/
      21             : /*                         GDALDatasetAlgorithm                         */
      22             : /************************************************************************/
      23             : 
      24          58 : class GDALDatasetAlgorithm final : public GDALAlgorithm
      25             : {
      26             :   public:
      27             :     static constexpr const char *NAME = "dataset";
      28             :     static constexpr const char *DESCRIPTION = "Commands to manage datasets.";
      29             :     static constexpr const char *HELP_URL = "/programs/gdal_dataset.html";
      30             : 
      31          29 :     GDALDatasetAlgorithm() : GDALAlgorithm(NAME, DESCRIPTION, HELP_URL)
      32             :     {
      33          29 :         RegisterSubAlgorithm<GDALDatasetIdentifyAlgorithm>();
      34          29 :         RegisterSubAlgorithm<GDALDatasetCopyAlgorithm>();
      35          29 :         RegisterSubAlgorithm<GDALDatasetRenameAlgorithm>();
      36          29 :         RegisterSubAlgorithm<GDALDatasetDeleteAlgorithm>();
      37          29 :     }
      38             : 
      39             :     ~GDALDatasetAlgorithm() override;
      40             : 
      41             :   private:
      42           1 :     bool RunImpl(GDALProgressFunc, void *) override
      43             :     {
      44           1 :         CPLError(CE_Failure, CPLE_AppDefined,
      45             :                  "The Run() method should not be called directly on the \"gdal "
      46             :                  "dataset\" program.");
      47           1 :         return false;
      48             :     }
      49             : };
      50             : 
      51             : GDALDatasetAlgorithm::~GDALDatasetAlgorithm() = default;
      52             : 
      53             : GDAL_STATIC_REGISTER_ALG(GDALDatasetAlgorithm);

Generated by: LCOV version 1.14