LCOV - code coverage report
Current view: top level - apps - gdalalg_vector_clip.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 4 4 100.0 %
Date: 2026-06-03 12:46:18 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  "clip" step of "vector pipeline", or "gdal vector clip" standalone
       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_VECTOR_CLIP_INCLUDED
      14             : #define GDALALG_VECTOR_CLIP_INCLUDED
      15             : 
      16             : #include "gdalvectorpipelinestepalgorithm.h"
      17             : 
      18             : #include "gdalalg_clip_common.h"
      19             : 
      20             : //! @cond Doxygen_Suppress
      21             : 
      22             : /************************************************************************/
      23             : /*                       GDALVectorClipAlgorithm                        */
      24             : /************************************************************************/
      25             : 
      26             : class GDALVectorClipAlgorithm /* non final */
      27             :     : public GDALVectorPipelineStepAlgorithm,
      28             :       public GDALClipCommon
      29             : {
      30             :   public:
      31             :     static constexpr const char *NAME = "clip";
      32             :     static constexpr const char *DESCRIPTION = "Clip a vector dataset.";
      33             :     static constexpr const char *HELP_URL = "/programs/gdal_vector_clip.html";
      34             : 
      35             :     explicit GDALVectorClipAlgorithm(bool standaloneStep = false);
      36             : 
      37             :   private:
      38             :     bool RunStep(GDALPipelineStepRunContext &ctxt) override;
      39             : 
      40             :     std::string m_activeLayer{};
      41             : };
      42             : 
      43             : /************************************************************************/
      44             : /*                  GDALVectorClipAlgorithmStandalone                   */
      45             : /************************************************************************/
      46             : 
      47         166 : class GDALVectorClipAlgorithmStandalone final : public GDALVectorClipAlgorithm
      48             : {
      49             :   public:
      50          83 :     GDALVectorClipAlgorithmStandalone()
      51          83 :         : GDALVectorClipAlgorithm(/* standaloneStep = */ true)
      52             :     {
      53          83 :     }
      54             : 
      55             :     ~GDALVectorClipAlgorithmStandalone() override;
      56             : };
      57             : 
      58             : //! @endcond
      59             : 
      60             : #endif /* GDALALG_VECTOR_CLIP_INCLUDED */

Generated by: LCOV version 1.14