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

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

Generated by: LCOV version 1.14