LCOV - code coverage report
Current view: top level - apps - gdalalg_vector_export_schema.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 6 6 100.0 %
Date: 2026-04-03 14:38:35 Functions: 4 4 100.0 %

          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 "gdalalg_vector_pipeline.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          12 :     bool CanBeLastStep() const override
      37             :     {
      38          12 :         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             : 
      51          90 : class GDALVectorExportSchemaAlgorithmStandalone final
      52             :     : public GDALVectorExportSchemaAlgorithm
      53             : {
      54             :   public:
      55          45 :     GDALVectorExportSchemaAlgorithmStandalone()
      56          45 :         : GDALVectorExportSchemaAlgorithm(/* standaloneStep = */ true)
      57             :     {
      58          45 :     }
      59             : 
      60             :     ~GDALVectorExportSchemaAlgorithmStandalone() override;
      61             : };
      62             : 
      63             : //! @endcond
      64             : 
      65             : #endif

Generated by: LCOV version 1.14