Line data Source code
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 "gdalvectorpipelinestepalgorithm.h" 17 : 18 : //! @cond Doxygen_Suppress 19 : 20 : /************************************************************************/ 21 : /* GDALVectorExportSchemaAlgorithm */ 22 : /************************************************************************/ 23 : 24 : class 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 14 : bool CanBeLastStep() const override 37 : { 38 14 : return true; 39 : } 40 : 41 : private: 42 : bool RunStep(GDALPipelineStepRunContext &ctxt) override; 43 : 44 : std::vector<std::string> m_layerNames{}; 45 : std::string m_outputFileName{}; 46 : }; 47 : 48 : /************************************************************************/ 49 : /* GDALVectorExportSchemaAlgorithmStandalone */ 50 : /************************************************************************/ 51 : 52 96 : class GDALVectorExportSchemaAlgorithmStandalone final 53 : : public GDALVectorExportSchemaAlgorithm 54 : { 55 : public: 56 48 : GDALVectorExportSchemaAlgorithmStandalone() 57 48 : : GDALVectorExportSchemaAlgorithm(/* standaloneStep = */ true) 58 : { 59 48 : } 60 : 61 : ~GDALVectorExportSchemaAlgorithmStandalone() override; 62 : }; 63 : 64 : //! @endcond 65 : 66 : #endif