GDAL

gdalalg_dataset_identify.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "dataset identify" subcommand
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_MANAGE_IDENTIFY_INCLUDED
14#define GDALALG_MANAGE_IDENTIFY_INCLUDED
15
16#include "gdalalgorithm.h"
17
18#include "cpl_json_streaming_writer.h"
19
21
22/************************************************************************/
23/* GDALDatasetIdentifyAlgorithm */
24/************************************************************************/
25
26 class GDALDatasetIdentifyAlgorithm final : public GDALAlgorithm
27{
28 public:
29 static constexpr const char *NAME = "identify";
30 static constexpr const char *DESCRIPTION =
31 "Identify driver opening dataset(s).";
32 static constexpr const char *HELP_URL =
33 "/programs/gdal_dataset_identify.html";
34
35 GDALDatasetIdentifyAlgorithm();
36
37 private:
38 std::vector<std::string> m_filename{};
39 std::string m_format{};
40 CPLJSonStreamingWriter m_oWriter;
41 std::string m_output{};
42 bool m_recursive = false;
43 bool m_forceRecursive = false;
44 bool m_reportFailures = false;
45 bool m_stdout = false;
46
47 bool RunImpl(GDALProgressFunc, void *) override;
48 void Print(const char *str);
49 bool Process(const char *pszTarget, CSLConstList papszSiblingList,
50 GDALProgressFunc pfnProgress, void *pProgressData);
51 static void JSONPrint(const char *pszTxt, void *pUserData);
52};
53
55
56#endif
GDALAlgorithm
GDAL algorithm.
Definition gdalalgorithm_cpp.h:2261
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087