LCOV - code coverage report
Current view: top level - apps - gdalalg_vector_info.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 8 8 100.0 %
Date: 2025-01-18 12:42:00 Functions: 2 2 100.0 %

          Line data    Source code
       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 "gdalalgorithm.h"
      17             : 
      18             : //! @cond Doxygen_Suppress
      19             : 
      20             : /************************************************************************/
      21             : /*                       GDALVectorInfoAlgorithm                        */
      22             : /************************************************************************/
      23             : 
      24             : class GDALVectorInfoAlgorithm final : public GDALAlgorithm
      25             : {
      26             :   public:
      27             :     static constexpr const char *NAME = "info";
      28             :     static constexpr const char *DESCRIPTION =
      29             :         "Return information on a vector dataset.";
      30             :     static constexpr const char *HELP_URL = "/programs/gdal_vector_info.html";
      31             : 
      32          85 :     static std::vector<std::string> GetAliases()
      33             :     {
      34          85 :         return {};
      35             :     }
      36             : 
      37             :     GDALVectorInfoAlgorithm();
      38             : 
      39           6 :     void SetDataset(GDALDataset *poDS)
      40             :     {
      41           6 :         auto arg = GetArg(GDAL_ARG_NAME_INPUT);
      42           6 :         if (arg)
      43             :         {
      44           6 :             arg->Set(poDS);
      45           6 :             arg->SetSkipIfAlreadySet();
      46             :         }
      47           6 :     }
      48             : 
      49             :   private:
      50             :     bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override;
      51             : 
      52             :     std::string m_format{};
      53             :     GDALArgDatasetValue m_dataset{};
      54             :     std::vector<std::string> m_openOptions{};
      55             :     std::vector<std::string> m_inputFormats{};
      56             :     bool m_update = false;
      57             :     std::vector<std::string> m_layerNames{};
      58             :     bool m_listFeatures = false;
      59             :     bool m_stdout = false;
      60             :     std::string m_sql{};
      61             :     std::string m_where{};
      62             :     std::string m_dialect{};
      63             :     std::string m_output{};
      64             : };
      65             : 
      66             : //! @endcond
      67             : 
      68             : #endif

Generated by: LCOV version 1.14