Coverage Report

Created: 2026-09-14 06:50

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/apps/gdalalg_vector_compare.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL
4
 * Purpose:  gdal "vector compare" subcommand
5
 * Author:   Even Rouault <even dot rouault at spatialys.com>
6
 *
7
 ******************************************************************************
8
 * Copyright (c) 2026, Even Rouault <even dot rouault at spatialys.com>
9
 *
10
 * SPDX-License-Identifier: MIT
11
 ****************************************************************************/
12
13
#ifndef GDALALG_VECTOR_COMPARE_INCLUDED
14
#define GDALALG_VECTOR_COMPARE_INCLUDED
15
16
#include "gdalvectorpipelinestepalgorithm.h"
17
#include "gdalalg_compare_common.h"
18
19
//! @cond Doxygen_Suppress
20
21
class GDALDataset;
22
class OGRLayer;
23
24
/************************************************************************/
25
/*                      GDALVectorCompareAlgorithm                      */
26
/************************************************************************/
27
28
class GDALVectorCompareAlgorithm /* non final */
29
    : public GDALVectorPipelineStepAlgorithm,
30
      public GDALCompareCommon
31
{
32
  public:
33
    static constexpr const char *NAME = "compare";
34
    static constexpr const char *DESCRIPTION = "Compare two vector datasets.";
35
    static constexpr const char *HELP_URL =
36
        "/programs/gdal_vector_compare.html";
37
38
    explicit GDALVectorCompareAlgorithm(bool standaloneStep = false);
39
40
    bool IsNativelyStreamingCompatible() const override
41
0
    {
42
0
        return false;
43
0
    }
44
45
    bool CanBeLastStep() const override
46
0
    {
47
0
        return true;
48
0
    }
49
50
    int GetOutputType() const override
51
0
    {
52
0
        return 0;
53
0
    }
54
55
  private:
56
    bool RunStep(GDALPipelineStepRunContext &ctxt) override;
57
58
    bool CompareLayer(std::vector<std::string> &aosReport, OGRLayer *poRefLayer,
59
                      OGRLayer *poInputLayer, GDALProgressFunc,
60
                      void *pProgressData);
61
62
    bool m_laxGeometryComparison = false;
63
64
    bool m_skipAllOptional = false;
65
    bool m_skipCRS = false;
66
    bool m_skipMetadata = false;
67
    bool m_skipFID = false;
68
    // If adding a new skip flag, make sure that m_skipAll takes it into account
69
};
70
71
/************************************************************************/
72
/*                 GDALVectorCompareAlgorithmStandalone                 */
73
/************************************************************************/
74
75
class GDALVectorCompareAlgorithmStandalone final
76
    : public GDALVectorCompareAlgorithm
77
{
78
  public:
79
    GDALVectorCompareAlgorithmStandalone()
80
0
        : GDALVectorCompareAlgorithm(/* standaloneStep = */ true)
81
0
    {
82
0
    }
83
84
    ~GDALVectorCompareAlgorithmStandalone() override;
85
};
86
87
//! @endcond
88
89
#endif