LCOV - code coverage report
Current view: top level - apps - gdalalg_raster_convert.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 9 9 100.0 %
Date: 2025-01-18 12:42:00 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  gdal "raster 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_RASTER_CONVERT_INCLUDED
      14             : #define GDALALG_RASTER_CONVERT_INCLUDED
      15             : 
      16             : #include "gdalalgorithm.h"
      17             : 
      18             : //! @cond Doxygen_Suppress
      19             : 
      20             : /************************************************************************/
      21             : /*                     GDALRasterConvertAlgorithm                       */
      22             : /************************************************************************/
      23             : 
      24             : class GDALRasterConvertAlgorithm final : public GDALAlgorithm
      25             : {
      26             :   public:
      27             :     static constexpr const char *NAME = "convert";
      28             :     static constexpr const char *DESCRIPTION = "Convert a raster dataset.";
      29             :     static constexpr const char *HELP_URL =
      30             :         "/programs/gdal_raster_convert.html";
      31             : 
      32         168 :     static std::vector<std::string> GetAliases()
      33             :     {
      34         168 :         return {};
      35             :     }
      36             : 
      37             :     explicit GDALRasterConvertAlgorithm(bool openForMixedRasterVector = false);
      38             : 
      39           4 :     GDALDataset *GetDatasetRef()
      40             :     {
      41           4 :         return m_inputDataset.GetDatasetRef();
      42             :     }
      43             : 
      44           1 :     void SetDataset(GDALDataset *poDS)
      45             :     {
      46           1 :         auto arg = GetArg(GDAL_ARG_NAME_INPUT);
      47           1 :         arg->Set(poDS);
      48           1 :         arg->SetSkipIfAlreadySet();
      49           1 :     }
      50             : 
      51             :   private:
      52             :     bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override;
      53             : 
      54             :     std::string m_outputFormat{};
      55             :     GDALArgDatasetValue m_inputDataset{};
      56             :     std::vector<std::string> m_openOptions{};
      57             :     std::vector<std::string> m_inputFormats{};
      58             :     GDALArgDatasetValue m_outputDataset{};
      59             :     std::vector<std::string> m_creationOptions{};
      60             :     bool m_overwrite = false;
      61             :     bool m_append = false;
      62             : };
      63             : 
      64             : //! @endcond
      65             : 
      66             : #endif

Generated by: LCOV version 1.14