GDAL
gdalalg_dataset_check.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "dataset check" 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_DATASET_CHECK_INCLUDED
14#define GDALALG_DATASET_CHECK_INCLUDED
15
16#include "gdalalgorithm.h"
17
19
20class GDALGroup;
21
22/************************************************************************/
23/* GDALDatasetCheckAlgorithm */
24/************************************************************************/
25
26class GDALDatasetCheckAlgorithm final : public GDALAlgorithm
27{
28 public:
29 static constexpr const char *NAME = "check";
30 static constexpr const char *DESCRIPTION =
31 "Check whether there are errors when reading the content of a dataset.";
32 static constexpr const char *HELP_URL = "/programs/gdal_dataset_check.html";
33
34 GDALDatasetCheckAlgorithm();
35
36 private:
37 GDALArgDatasetValue m_input{};
38 std::vector<std::string> m_openOptions{};
39 std::vector<std::string> m_inputFormats{};
40 int m_retCode = 0;
41
42 bool CheckDataset(GDALDataset *poDS, bool bRasterOnly, GDALProgressFunc,
43 void *);
44 bool CheckGroup(GDALGroup *poGroup, GIntBig &nProgress,
45 GIntBig nTotalContent, GDALProgressFunc, void *);
46 bool RunImpl(GDALProgressFunc, void *) override;
47};
48
50
51#endif
GDAL algorithm.
Definition gdalalgorithm_cpp.h:2445
Value for an argument that points to a GDALDataset.
Definition gdalalgorithm_cpp.h:163
A set of associated raster bands, usually from one file.
Definition gdal_dataset.h:77
Class modeling a named container of GDALAttribute, GDALMDArray, OGRLayer or other GDALGroup.
Definition gdal_multidim.h:305
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:195