LCOV - code coverage report
Current view: top level - apps - gdalalg_convert.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 3 3 100.0 %
Date: 2026-01-11 15:50:51 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  gdal "convert" 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_CONVERT_INCLUDED
      14             : #define GDALALG_CONVERT_INCLUDED
      15             : 
      16             : //! @cond Doxygen_Suppress
      17             : 
      18             : #include "gdalalgorithm.h"
      19             : #include "gdalalg_raster_convert.h"
      20             : #include "gdalalg_vector_convert.h"
      21             : #include "gdalalg_dispatcher.h"
      22             : 
      23             : /************************************************************************/
      24             : /*                        GDALConvertAlgorithm                          */
      25             : /************************************************************************/
      26             : 
      27          28 : class GDALConvertAlgorithm final
      28             :     : public GDALDispatcherAlgorithm<GDALRasterConvertAlgorithm,
      29             :                                      GDALVectorConvertAlgorithm>
      30             : {
      31             :   public:
      32             :     static constexpr const char *NAME = "convert";
      33             :     static constexpr const char *DESCRIPTION =
      34             :         "Convert a dataset (shortcut for 'gdal raster convert' or "
      35             :         "'gdal vector convert').";
      36             :     static constexpr const char *HELP_URL = "/programs/gdal_convert.html";
      37             : 
      38        1585 :     static std::vector<std::string> GetAliasesStatic()
      39             :     {
      40        4755 :         return {GDALAlgorithmRegistry::HIDDEN_ALIAS_SEPARATOR, "translate"};
      41             :     }
      42             : 
      43             :     GDALConvertAlgorithm();
      44             : 
      45             :     ~GDALConvertAlgorithm() override;
      46             : 
      47             :   private:
      48             :     std::string m_format{};
      49             :     GDALArgDatasetValue m_inputDataset{};
      50             :     GDALArgDatasetValue m_outputDataset{};
      51             : };
      52             : 
      53             : //! @endcond
      54             : 
      55             : #endif

Generated by: LCOV version 1.14