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

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  OpenGIS Simple Features Reference Implementation
       4             :  * Purpose:  Private definitions for OGR/GPSBabel driver.
       5             :  * Author:   Even Rouault, <even dot rouault at spatialys.com>
       6             :  *
       7             :  ******************************************************************************
       8             :  * Copyright (c) 2010, Even Rouault <even dot rouault at spatialys.com>
       9             :  *
      10             :  * SPDX-License-Identifier: MIT
      11             :  ****************************************************************************/
      12             : 
      13             : #ifndef OGR_GPSBABEL_H_INCLUDED
      14             : #define OGR_GPSBABEL_H_INCLUDED
      15             : 
      16             : #include "ogrsf_frmts.h"
      17             : #include "cpl_string.h"
      18             : #include <array>
      19             : 
      20             : /************************************************************************/
      21             : /*                        OGRGPSBabelDataSource                         */
      22             : /************************************************************************/
      23             : 
      24             : class OGRGPSBabelDataSource final : public GDALDataset
      25             : {
      26             :     int nLayers = 0;
      27             :     std::array<OGRLayer *, 5> apoLayers{
      28             :         {nullptr, nullptr, nullptr, nullptr, nullptr}};
      29             :     char *pszGPSBabelDriverName = nullptr;
      30             :     char *pszFilename = nullptr;
      31             :     CPLString osTmpFileName{};
      32             :     GDALDataset *poGPXDS = nullptr;
      33             : 
      34             :   public:
      35             :     OGRGPSBabelDataSource();
      36             :     virtual ~OGRGPSBabelDataSource();
      37             : 
      38             :     virtual int CloseDependentDatasets() override;
      39             : 
      40           5 :     virtual int GetLayerCount() override
      41             :     {
      42           5 :         return nLayers;
      43             :     }
      44             : 
      45             :     virtual OGRLayer *GetLayer(int) override;
      46             : 
      47             :     int Open(const char *pszFilename, const char *pszGPSBabelDriverNameIn,
      48             :              char **papszOpenOptions);
      49             : 
      50             :     static bool IsSpecialFile(const char *pszFilename);
      51             :     static bool IsValidDriverName(const char *pszGPSBabelDriverName);
      52             : };
      53             : 
      54             : /************************************************************************/
      55             : /*                   OGRGPSBabelWriteDataSource                         */
      56             : /************************************************************************/
      57             : 
      58             : class OGRGPSBabelWriteDataSource final : public GDALDataset
      59             : {
      60             :     char *pszGPSBabelDriverName;
      61             :     char *pszFilename;
      62             :     CPLString osTmpFileName;
      63             :     GDALDataset *poGPXDS;
      64             : 
      65             :     bool Convert();
      66             : 
      67             :   public:
      68             :     OGRGPSBabelWriteDataSource();
      69             :     virtual ~OGRGPSBabelWriteDataSource();
      70             : 
      71             :     virtual int GetLayerCount() override;
      72             :     virtual OGRLayer *GetLayer(int) override;
      73             : 
      74             :     virtual int TestCapability(const char *) override;
      75             : 
      76             :     OGRLayer *ICreateLayer(const char *pszName,
      77             :                            const OGRGeomFieldDefn *poGeomFieldDefn,
      78             :                            CSLConstList papszOptions) override;
      79             : 
      80             :     int Create(const char *pszFilename, char **papszOptions);
      81             : };
      82             : 
      83             : #endif /* ndef OGR_GPSBABEL_H_INCLUDED */

Generated by: LCOV version 1.14