LCOV - code coverage report
Current view: top level - ogr/ogrsf_frmts/ogdi - ogrogdidrivercore.cpp (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 19 19 100.0 %
Date: 2024-04-30 17:17:22 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  OGDI Bridge
       4             :  * Purpose:  Implements OGROGDIDriver class.
       5             :  * Author:   Daniel Morissette, danmo@videotron.ca
       6             :  *           (Based on some code contributed by Frank Warmerdam :)
       7             :  *
       8             :  ******************************************************************************
       9             :  * Copyright (c) 2000, Daniel Morissette
      10             :  *
      11             :  * Permission is hereby granted, free of charge, to any person obtaining a
      12             :  * copy of this software and associated documentation files (the "Software"),
      13             :  * to deal in the Software without restriction, including without limitation
      14             :  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
      15             :  * and/or sell copies of the Software, and to permit persons to whom the
      16             :  * Software is furnished to do so, subject to the following conditions:
      17             :  *
      18             :  * The above copyright notice and this permission notice shall be included
      19             :  * in all copies or substantial portions of the Software.
      20             :  *
      21             :  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
      22             :  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      23             :  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
      24             :  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      25             :  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
      26             :  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
      27             :  * DEALINGS IN THE SOFTWARE.
      28             :  ****************************************************************************/
      29             : 
      30             : #include "ogrsf_frmts.h"
      31             : 
      32             : #include "ogrogdidrivercore.h"
      33             : 
      34             : /************************************************************************/
      35             : /*                    OGROGDIDriverIdentify()                           */
      36             : /************************************************************************/
      37             : 
      38       43194 : static int OGROGDIDriverIdentify(GDALOpenInfo *poOpenInfo)
      39             : 
      40             : {
      41       43194 :     return STARTS_WITH(poOpenInfo->pszFilename, "gltp:");
      42             : }
      43             : 
      44             : /************************************************************************/
      45             : /*                  OGROGDIDriverSetCommonMetadata()                    */
      46             : /************************************************************************/
      47             : 
      48        1225 : void OGROGDIDriverSetCommonMetadata(GDALDriver *poDriver)
      49             : {
      50        1225 :     poDriver->SetDescription(DRIVER_NAME);
      51        1225 :     poDriver->SetMetadataItem(GDAL_DCAP_VECTOR, "YES");
      52             : 
      53        1225 :     poDriver->SetMetadataItem(GDAL_DMD_LONGNAME,
      54        1225 :                               "OGDI Vectors (VPF, VMAP, DCW)");
      55        1225 :     poDriver->SetMetadataItem(GDAL_DMD_HELPTOPIC, "drivers/vector/ogdi.html");
      56        1225 :     poDriver->SetMetadataItem(GDAL_DCAP_MULTIPLE_VECTOR_LAYERS, "YES");
      57        1225 :     poDriver->SetMetadataItem(GDAL_DMD_SUPPORTED_SQL_DIALECTS, "OGRSQL SQLITE");
      58             : 
      59        1225 :     poDriver->pfnIdentify = OGROGDIDriverIdentify;
      60        1225 :     poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
      61        1225 : }
      62             : 
      63             : /************************************************************************/
      64             : /*                   DeclareDeferredOGROGDIPlugin()                     */
      65             : /************************************************************************/
      66             : 
      67             : #ifdef PLUGIN_FILENAME
      68        1512 : void DeclareDeferredOGROGDIPlugin()
      69             : {
      70        1512 :     if (GDALGetDriverByName(DRIVER_NAME) != nullptr)
      71             :     {
      72         295 :         return;
      73             :     }
      74        1217 :     auto poDriver = new GDALPluginDriverProxy(PLUGIN_FILENAME);
      75             : #ifdef PLUGIN_INSTALLATION_MESSAGE
      76             :     poDriver->SetMetadataItem(GDAL_DMD_PLUGIN_INSTALLATION_MESSAGE,
      77             :                               PLUGIN_INSTALLATION_MESSAGE);
      78             : #endif
      79        1217 :     OGROGDIDriverSetCommonMetadata(poDriver);
      80        1217 :     GetGDALDriverManager()->DeclareDeferredPluginDriver(poDriver);
      81             : }
      82             : #endif

Generated by: LCOV version 1.14