LCOV - code coverage report
Current view: top level - apps - gdalalg_vector_edit.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 5 5 100.0 %
Date: 2025-03-28 11:40:40 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  "edit" step of "vector pipeline"
       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             : #ifndef GDALALG_RASTER_EDIT_INCLUDED
      14             : #define GDALALG_RASTER_EDIT_INCLUDED
      15             : 
      16             : #include "gdalalg_vector_pipeline.h"
      17             : 
      18             : //! @cond Doxygen_Suppress
      19             : 
      20             : /************************************************************************/
      21             : /*                       GDALVectorEditAlgorithm                        */
      22             : /************************************************************************/
      23             : 
      24             : class GDALVectorEditAlgorithm /* non final */
      25             :     : public GDALVectorPipelineStepAlgorithm
      26             : {
      27             :   public:
      28             :     static constexpr const char *NAME = "edit";
      29             :     static constexpr const char *DESCRIPTION =
      30             :         "Edit metadata of a vector dataset.";
      31             :     static constexpr const char *HELP_URL = "/programs/gdal_vector_edit.html";
      32             : 
      33         314 :     static std::vector<std::string> GetAliases()
      34             :     {
      35         314 :         return {};
      36             :     }
      37             : 
      38             :     explicit GDALVectorEditAlgorithm(bool standaloneStep = false);
      39             : 
      40             :   private:
      41             :     bool RunStep(GDALProgressFunc pfnProgress, void *pProgressData) override;
      42             : 
      43             :     std::string m_activeLayer{};
      44             :     std::string m_overrideCrs{};
      45             :     std::string m_geometryType{};
      46             :     std::vector<std::string> m_metadata{};
      47             :     std::vector<std::string> m_unsetMetadata{};
      48             :     std::vector<std::string> m_layerMetadata{};
      49             :     std::vector<std::string> m_unsetLayerMetadata{};
      50             : };
      51             : 
      52             : /************************************************************************/
      53             : /*                   GDALVectorEditAlgorithmStandalone                  */
      54             : /************************************************************************/
      55             : 
      56             : class GDALVectorEditAlgorithmStandalone final : public GDALVectorEditAlgorithm
      57             : {
      58             :   public:
      59           8 :     GDALVectorEditAlgorithmStandalone()
      60           8 :         : GDALVectorEditAlgorithm(/* standaloneStep = */ true)
      61             :     {
      62           8 :     }
      63             : };
      64             : 
      65             : //! @endcond
      66             : 
      67             : #endif /* GDALALG_RASTER_EDIT_INCLUDED */

Generated by: LCOV version 1.14