Coverage Report

Created: 2026-02-14 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/apps/gdalalg_raster_info.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL
4
 * Purpose:  gdal "raster info" 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_RASTER_INFO_INCLUDED
14
#define GDALALG_RASTER_INFO_INCLUDED
15
16
#include "gdalalg_raster_pipeline.h"
17
18
//! @cond Doxygen_Suppress
19
20
/************************************************************************/
21
/*                       GDALRasterInfoAlgorithm                        */
22
/************************************************************************/
23
24
class GDALRasterInfoAlgorithm /* non final */
25
    : public GDALRasterPipelineStepAlgorithm
26
{
27
  public:
28
    static constexpr const char *NAME = "info";
29
    static constexpr const char *DESCRIPTION =
30
        "Return information on a raster dataset.";
31
    static constexpr const char *HELP_URL = "/programs/gdal_raster_info.html";
32
33
    explicit GDALRasterInfoAlgorithm(bool standaloneStep = false,
34
                                     bool openForMixedRasterVector = false);
35
36
    bool CanBeLastStep() const override
37
0
    {
38
0
        return true;
39
0
    }
40
41
  private:
42
    bool RunStep(GDALPipelineStepRunContext &ctxt) override;
43
44
    bool m_minMax = false;
45
    bool m_stats = false;
46
    bool m_approxStats = false;
47
    bool m_hist = false;
48
    bool m_noGCP = false;
49
    bool m_noMD = false;
50
    bool m_noCT = false;
51
    bool m_noFL = false;
52
    bool m_noMask = false;
53
    bool m_noNodata = false;
54
    bool m_checksum = false;
55
    bool m_listMDD = false;
56
    std::string m_mdd{};
57
    int m_subDS = 0;
58
};
59
60
/************************************************************************/
61
/*                  GDALRasterInfoAlgorithmStandalone                   */
62
/************************************************************************/
63
64
class GDALRasterInfoAlgorithmStandalone final : public GDALRasterInfoAlgorithm
65
{
66
  public:
67
    GDALRasterInfoAlgorithmStandalone()
68
0
        : GDALRasterInfoAlgorithm(/* standaloneStep = */ true)
69
0
    {
70
0
    }
71
72
    ~GDALRasterInfoAlgorithmStandalone() override;
73
};
74
75
//! @endcond
76
77
#endif