LCOV - code coverage report
Current view: top level - apps - gdalalg_vector_convert.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 6 6 100.0 %
Date: 2025-05-15 18:21:54 Functions: 1 1 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_vector_convert.html";
      31             : 
      32             :     GDALVectorConvertAlgorithm();
      33             : 
      34           1 :     void SetDataset(GDALDataset *poDS)
      35             :     {
      36           1 :         auto arg = GetArg(GDAL_ARG_NAME_INPUT);
      37           1 :         if (arg)
      38             :         {
      39           1 :             arg->Set(poDS);
      40           1 :             arg->SetSkipIfAlreadySet();
      41             :         }
      42           1 :     }
      43             : 
      44             :   private:
      45             :     bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override;
      46             : 
      47             :     std::string m_outputFormat{};
      48             :     GDALArgDatasetValue m_inputDataset{};
      49             :     std::vector<std::string> m_openOptions{};
      50             :     std::vector<std::string> m_inputFormats{};
      51             :     GDALArgDatasetValue m_outputDataset{};
      52             :     std::vector<std::string> m_creationOptions{};
      53             :     std::vector<std::string> m_layerCreationOptions{};
      54             :     bool m_overwrite = false;
      55             :     bool m_update = false;
      56             :     bool m_overwriteLayer = false;
      57             :     bool m_appendLayer = false;
      58             :     std::vector<std::string> m_inputLayerNames{};
      59             :     std::string m_outputLayerName{};
      60             : };
      61             : 
      62             : //! @endcond
      63             : 
      64             : #endif

Generated by: LCOV version 1.14