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

          Line data    Source code
       1             : /******************************************************************************
       2             :  * Project:  OGR
       3             :  * Purpose:  OGRGMLASDriver implementation
       4             :  * Author:   Even Rouault, <even dot rouault at spatialys dot com>
       5             :  *
       6             :  * Initial development funded by the European Earth observation programme
       7             :  * Copernicus
       8             :  *
       9             :  ******************************************************************************
      10             :  * Copyright (c) 2016, Even Rouault, <even dot rouault at spatialys dot com>
      11             :  *
      12             :  * SPDX-License-Identifier: MIT
      13             :  ****************************************************************************/
      14             : 
      15             : #include "ogr_gmlas.h"
      16             : #include "ogrgmlasdrivercore.h"
      17             : 
      18             : // g++ -I/usr/include/json -DxDEBUG_VERBOSE -DDEBUG   -g -DDEBUG -ftrapv  -Wall
      19             : // -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security
      20             : // -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla
      21             : // -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual
      22             : // -fno-operator-names ogr/ogrsf_frmts/gmlas/*.cpp -fPIC -shared -o ogr_GMLAS.so
      23             : // -Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/mem  -L. -lgdal
      24             : // -I/home/even/spatialys/eea/inspire_gml/install-xerces-c-3.1.3/include
      25             : 
      26             : /************************************************************************/
      27             : /*                           OGRGMLASDriverOpen()                       */
      28             : /************************************************************************/
      29             : 
      30         177 : static GDALDataset *OGRGMLASDriverOpen(GDALOpenInfo *poOpenInfo)
      31             : 
      32             : {
      33             :     OGRGMLASDataSource *poDS;
      34             : 
      35         177 :     if (poOpenInfo->eAccess == GA_Update)
      36           0 :         return nullptr;
      37             : 
      38         177 :     if (OGRGMLASDriverIdentify(poOpenInfo) == FALSE)
      39           0 :         return nullptr;
      40             : 
      41         177 :     poDS = new OGRGMLASDataSource();
      42             : 
      43         177 :     if (!poDS->Open(poOpenInfo))
      44             :     {
      45          18 :         delete poDS;
      46          18 :         return nullptr;
      47             :     }
      48             :     else
      49         159 :         return poDS;
      50             : }
      51             : 
      52             : /************************************************************************/
      53             : /*                          RegisterOGRGMLAS()                          */
      54             : /************************************************************************/
      55             : 
      56        1595 : void RegisterOGRGMLAS()
      57             : 
      58             : {
      59        1595 :     if (GDALGetDriverByName(DRIVER_NAME) != nullptr)
      60         302 :         return;
      61             : 
      62        1293 :     GDALDriver *poDriver = new GDALDriver();
      63        1293 :     OGRGMLASDriverSetCommonMetadata(poDriver);
      64             : 
      65        1293 :     poDriver->pfnOpen = OGRGMLASDriverOpen;
      66        1293 :     poDriver->pfnCreateCopy = OGRGMLASDriverCreateCopy;
      67             : 
      68        1293 :     GetGDALDriverManager()->RegisterDriver(poDriver);
      69             : }

Generated by: LCOV version 1.14