GDAL
gdalalg_vector_info.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "vector 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_VECTOR_INFO_INCLUDED
14#define GDALALG_VECTOR_INFO_INCLUDED
15
16#include "gdalalg_vector_pipeline.h"
17
19
20/************************************************************************/
21/* GDALVectorInfoAlgorithm */
22/************************************************************************/
23
24class GDALVectorInfoAlgorithm /* non final */
25 : public GDALVectorPipelineStepAlgorithm
26{
27 public:
28 static constexpr const char *NAME = "info";
29 static constexpr const char *DESCRIPTION =
30 "Return information on a vector dataset.";
31 static constexpr const char *HELP_URL = "/programs/gdal_vector_info.html";
32
33 explicit GDALVectorInfoAlgorithm(bool standaloneStep = false);
34
35 bool CanBeLastStep() const override
36 {
37 return true;
38 }
39
40 private:
41 bool RunStep(GDALPipelineStepRunContext &ctxt) override;
42
43 std::vector<std::string> m_layerNames{};
44 bool m_listFeatures = false;
45 bool m_summaryOnly = false;
46 std::string m_sql{};
47 std::string m_where{};
48 std::string m_dialect{};
49 int m_limit = 0;
50};
51
52/************************************************************************/
53/* GDALVectorInfoAlgorithmStandalone */
54/************************************************************************/
55
56class GDALVectorInfoAlgorithmStandalone final : public GDALVectorInfoAlgorithm
57{
58 public:
59 GDALVectorInfoAlgorithmStandalone()
60 : GDALVectorInfoAlgorithm(/* standaloneStep = */ true)
61 {
62 }
63
64 ~GDALVectorInfoAlgorithmStandalone() override;
65};
66
68
69#endif