GDAL
gdalalg_vector_export_schema.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "vector export-schema" subcommand
5 * Author: Alessandro Pasotti <elpaso at itopen dot it>
6 *
7 ******************************************************************************
8 * Copyright (c) 2026, Alessandro Pasotti <elpaso at itopen dot it>
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDALALG_VECTOR_EXPORT_SCHEMA_INCLUDED
14#define GDALALG_VECTOR_EXPORT_SCHEMA_INCLUDED
15
16#include "gdalalg_vector_pipeline.h"
17
19
20/************************************************************************/
21/* GDALVectorExportSchemaAlgorithm */
22/************************************************************************/
23
24class GDALVectorExportSchemaAlgorithm /* non final */
25 : public GDALVectorPipelineStepAlgorithm
26{
27 public:
28 static constexpr const char *NAME = "export-schema";
29 static constexpr const char *DESCRIPTION =
30 "Export the OGR_SCHEMA from a vector dataset.";
31 static constexpr const char *HELP_URL =
32 "/programs/gdal_vector_export_schema.html";
33
34 explicit GDALVectorExportSchemaAlgorithm(bool standaloneStep = false);
35
36 bool CanBeLastStep() const override
37 {
38 return true;
39 }
40
41 private:
42 bool RunStep(GDALPipelineStepRunContext &ctxt) override;
43
44 std::vector<std::string> m_layerNames{};
45};
46
47/************************************************************************/
48/* GDALVectorExportSchemaAlgorithmStandalone */
49/************************************************************************/
50
51class GDALVectorExportSchemaAlgorithmStandalone final
52 : public GDALVectorExportSchemaAlgorithm
53{
54 public:
55 GDALVectorExportSchemaAlgorithmStandalone()
56 : GDALVectorExportSchemaAlgorithm(/* standaloneStep = */ true)
57 {
58 }
59
60 ~GDALVectorExportSchemaAlgorithmStandalone() override;
61};
62
64
65#endif