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: 2024-11-21 22:18:42 Functions: 1 1 100.0 %

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

Generated by: LCOV version 1.14