Coverage Report

Created: 2026-02-14 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/apps/gdalalg_vector_clip.h
Line
Count
Source
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 "gdalalg_vector_pipeline.h"
17
#include "gdalalg_clip_common.h"
18
19
//! @cond Doxygen_Suppress
20
21
/************************************************************************/
22
/*                       GDALVectorClipAlgorithm                        */
23
/************************************************************************/
24
25
class GDALVectorClipAlgorithm /* non final */
26
    : public GDALVectorPipelineStepAlgorithm,
27
      public GDALClipCommon
28
{
29
  public:
30
    static constexpr const char *NAME = "clip";
31
    static constexpr const char *DESCRIPTION = "Clip a vector dataset.";
32
    static constexpr const char *HELP_URL = "/programs/gdal_vector_clip.html";
33
34
    explicit GDALVectorClipAlgorithm(bool standaloneStep = false);
35
36
  private:
37
    bool RunStep(GDALPipelineStepRunContext &ctxt) override;
38
39
    std::string m_activeLayer{};
40
};
41
42
/************************************************************************/
43
/*                  GDALVectorClipAlgorithmStandalone                   */
44
/************************************************************************/
45
46
class GDALVectorClipAlgorithmStandalone final : public GDALVectorClipAlgorithm
47
{
48
  public:
49
    GDALVectorClipAlgorithmStandalone()
50
0
        : GDALVectorClipAlgorithm(/* standaloneStep = */ true)
51
0
    {
52
0
    }
53
54
    ~GDALVectorClipAlgorithmStandalone() override;
55
};
56
57
//! @endcond
58
59
#endif /* GDALALG_VECTOR_CLIP_INCLUDED */