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 : 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 28 : GDALDatasetAlgorithm() : GDALAlgorithm(NAME, DESCRIPTION, HELP_URL) 32 : { 33 28 : RegisterSubAlgorithm<GDALDatasetIdentifyAlgorithm>(); 34 28 : RegisterSubAlgorithm<GDALDatasetCopyAlgorithm>(); 35 28 : RegisterSubAlgorithm<GDALDatasetRenameAlgorithm>(); 36 28 : RegisterSubAlgorithm<GDALDatasetDeleteAlgorithm>(); 37 28 : } 38 : 39 : private: 40 1 : bool RunImpl(GDALProgressFunc, void *) override 41 : { 42 1 : CPLError(CE_Failure, CPLE_AppDefined, 43 : "The Run() method should not be called directly on the \"gdal " 44 : "dataset\" program."); 45 1 : return false; 46 : } 47 : }; 48 : 49 : GDAL_STATIC_REGISTER_ALG(GDALDatasetAlgorithm);