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

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  XLS Translator
       4             :  * Purpose:  Implements OGRXLSDriver.
       5             :  * Author:   Even Rouault, even dot rouault at spatialys.com
       6             :  *
       7             :  ******************************************************************************
       8             :  * Copyright (c) 2011, Even Rouault <even dot rouault at spatialys.com>
       9             :  *
      10             :  * SPDX-License-Identifier: MIT
      11             :  ****************************************************************************/
      12             : 
      13             : #include "ogrsf_frmts.h"
      14             : 
      15             : #include "ogrxlsdrivercore.h"
      16             : 
      17             : /************************************************************************/
      18             : /*                    OGRXLSDriverIdentify()                            */
      19             : /************************************************************************/
      20             : 
      21       45220 : static int OGRXLSDriverIdentify(GDALOpenInfo *poOpenInfo)
      22             : 
      23             : {
      24       45220 :     return EQUAL(CPLGetExtension(poOpenInfo->pszFilename), "XLS");
      25             : }
      26             : 
      27             : /************************************************************************/
      28             : /*                  OGRXLSDriverSetCommonMetadata()                  */
      29             : /************************************************************************/
      30             : 
      31        1303 : void OGRXLSDriverSetCommonMetadata(GDALDriver *poDriver)
      32             : {
      33        1303 :     poDriver->SetDescription(DRIVER_NAME);
      34        1303 :     poDriver->SetMetadataItem(GDAL_DCAP_VECTOR, "YES");
      35             : 
      36        1303 :     poDriver->SetMetadataItem(GDAL_DMD_LONGNAME, "MS Excel format");
      37        1303 :     poDriver->SetMetadataItem(GDAL_DMD_EXTENSION, "xls");
      38        1303 :     poDriver->SetMetadataItem(GDAL_DMD_HELPTOPIC, "drivers/vector/xls.html");
      39        1303 :     poDriver->SetMetadataItem(GDAL_DCAP_NONSPATIAL, "YES");
      40        1303 :     poDriver->SetMetadataItem(GDAL_DCAP_MULTIPLE_VECTOR_LAYERS, "YES");
      41        1303 :     poDriver->SetMetadataItem(GDAL_DMD_SUPPORTED_SQL_DIALECTS, "OGRSQL SQLITE");
      42             : 
      43        1303 :     poDriver->pfnIdentify = OGRXLSDriverIdentify;
      44        1303 :     poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
      45        1303 : }
      46             : 
      47             : /************************************************************************/
      48             : /*                   DeclareDeferredOGRXLSPlugin()                      */
      49             : /************************************************************************/
      50             : 
      51             : #ifdef PLUGIN_FILENAME
      52        1595 : void DeclareDeferredOGRXLSPlugin()
      53             : {
      54        1595 :     if (GDALGetDriverByName(DRIVER_NAME) != nullptr)
      55             :     {
      56         302 :         return;
      57             :     }
      58        1293 :     auto poDriver = new GDALPluginDriverProxy(PLUGIN_FILENAME);
      59             : #ifdef PLUGIN_INSTALLATION_MESSAGE
      60             :     poDriver->SetMetadataItem(GDAL_DMD_PLUGIN_INSTALLATION_MESSAGE,
      61             :                               PLUGIN_INSTALLATION_MESSAGE);
      62             : #endif
      63        1293 :     OGRXLSDriverSetCommonMetadata(poDriver);
      64        1293 :     GetGDALDriverManager()->DeclareDeferredPluginDriver(poDriver);
      65             : }
      66             : #endif

Generated by: LCOV version 1.14