LCOV - code coverage report
Current view: top level - apps - gdalalg_vector_swap_xy.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 4 4 100.0 %
Date: 2025-06-19 12:30:01 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL
       4             :  * Purpose:  "gdal vector swap-xy"
       5             :  * Author:   Even Rouault <even dot rouault at spatialys.com>
       6             :  *
       7             :  ******************************************************************************
       8             :  * Copyright (c) 2025, Even Rouault <even dot rouault at spatialys.com>
       9             :  *
      10             :  * SPDX-License-Identifier: MIT
      11             :  ****************************************************************************/
      12             : 
      13             : #ifndef GDALALG_VECTOR_SWAP_XY_INCLUDED
      14             : #define GDALALG_VECTOR_SWAP_XY_INCLUDED
      15             : 
      16             : #include "gdalalg_vector_geom.h"
      17             : 
      18             : //! @cond Doxygen_Suppress
      19             : 
      20             : /************************************************************************/
      21             : /*                      GDALVectorSwapXYAlgorithm                       */
      22             : /************************************************************************/
      23             : 
      24             : class GDALVectorSwapXYAlgorithm /* non final */
      25             :     : public GDALVectorGeomAbstractAlgorithm
      26             : {
      27             :   public:
      28             :     static constexpr const char *NAME = "swap-xy";
      29             :     static constexpr const char *DESCRIPTION =
      30             :         "Swap X and Y coordinates of geometries of a vector dataset.";
      31             :     static constexpr const char *HELP_URL =
      32             :         "/programs/gdal_vector_swap_xy.html";
      33             : 
      34             :     struct Options : public GDALVectorGeomAbstractAlgorithm::OptionsBase
      35             :     {
      36             :     };
      37             : 
      38             :     std::unique_ptr<OGRLayerWithTranslateFeature>
      39             :     CreateAlgLayer(OGRLayer &srcLayer) override;
      40             : 
      41             :     explicit GDALVectorSwapXYAlgorithm(bool standaloneStep = false);
      42             : 
      43             :   private:
      44             :     Options m_opts{};
      45             : };
      46             : 
      47             : /************************************************************************/
      48             : /*                  GDALVectorSwapXYAlgorithmStandalone                 */
      49             : /************************************************************************/
      50             : 
      51           4 : class GDALVectorSwapXYAlgorithmStandalone final
      52             :     : public GDALVectorSwapXYAlgorithm
      53             : {
      54             :   public:
      55           2 :     GDALVectorSwapXYAlgorithmStandalone()
      56           2 :         : GDALVectorSwapXYAlgorithm(/* standaloneStep = */ true)
      57             :     {
      58           2 :     }
      59             : 
      60             :     ~GDALVectorSwapXYAlgorithmStandalone() override;
      61             : };
      62             : 
      63             : //! @endcond
      64             : 
      65             : #endif /* GDALALG_VECTOR_SWAP_XY_INCLUDED */

Generated by: LCOV version 1.14