LCOV - code coverage report
Current view: top level - ogr/ogrsf_frmts/xodr - ogrxodrdriver.cpp (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 13 17 76.5 %
Date: 2024-11-21 22:18:42 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  OpenGIS Simple Features for OpenDRIVE
       4             :  * Purpose:  Implementation of OGRXODRDriver.
       5             :  * Author:   Michael Scholz, German Aerospace Center (DLR)
       6             :  *           Gülsen Bardak, German Aerospace Center (DLR)        
       7             :  *
       8             :  ******************************************************************************
       9             :  * Copyright 2024 German Aerospace Center (DLR), Institute of Transportation Systems
      10             :  *
      11             :  * SPDX-License-Identifier: MIT
      12             :  ****************************************************************************/
      13             : 
      14             : #include "ogr_xodr.h"
      15             : #include "ogrxodrdrivercore.h"
      16             : #include "cpl_conv.h"
      17             : #include "cpl_error.h"
      18             : 
      19          13 : static GDALDataset *OGRXODRDriverOpen(GDALOpenInfo *poOpenInfo)
      20             : {
      21          13 :     if (poOpenInfo->eAccess == GA_Update || poOpenInfo->fpL == nullptr)
      22           0 :         return nullptr;
      23             : 
      24          26 :     auto dataSource = std::make_unique<OGRXODRDataSource>();
      25             : 
      26          26 :     if (!dataSource->Open(poOpenInfo->pszFilename,
      27          13 :                           poOpenInfo->papszOpenOptions))
      28             :     {
      29           0 :         return nullptr;
      30             :     }
      31             : 
      32          13 :     return dataSource.release();
      33             : }
      34             : 
      35          10 : void RegisterOGRXODR()
      36             : {
      37          10 :     if (!GDAL_CHECK_VERSION(DRIVER_NAME))
      38           0 :         return;
      39             : 
      40          10 :     if (GDALGetDriverByName(DRIVER_NAME) != nullptr)
      41           0 :         return;
      42             : 
      43          10 :     GDALDriver *poDriver = new GDALDriver();
      44          10 :     OGRXODRDriverSetCommonMetadata(poDriver);
      45          10 :     poDriver->pfnOpen = OGRXODRDriverOpen;
      46          10 :     GetGDALDriverManager()->RegisterDriver(poDriver);
      47             : }

Generated by: LCOV version 1.14