LCOV - code coverage report
Current view: directory - ogr/ogrsf_frmts/gft - ogrgftdriver.cpp (source / functions) Found Hit Coverage
Test: gdal_filtered.info Lines: 23 13 56.5 %
Date: 2011-12-18 Functions: 8 4 50.0 %

       1                 : /******************************************************************************
       2                 :  * $Id: ogrgftdriver.cpp 22070 2011-03-29 21:56:51Z rouault $
       3                 :  *
       4                 :  * Project:  GFT Translator
       5                 :  * Purpose:  Implements OGRGFTDriver.
       6                 :  * Author:   Even Rouault, even dot rouault at mines dash paris dot org
       7                 :  *
       8                 :  ******************************************************************************
       9                 :  * Copyright (c) 2011, Even Rouault <even dot rouault at mines dash paris dot org>
      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 "ogr_gft.h"
      31                 : 
      32                 : // g++ -g -Wall -fPIC -shared -o ogr_GFT.so -Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/gft ogr/ogrsf_frmts/gft/*.c* -L. -lgdal
      33                 : 
      34                 : /* http://code.google.com/intl/fr/apis/fusiontables/docs/developers_reference.html */
      35                 : 
      36                 : CPL_CVSID("$Id: ogrgftdriver.cpp 22070 2011-03-29 21:56:51Z rouault $");
      37                 : 
      38                 : extern "C" void RegisterOGRGFT();
      39                 : 
      40                 : /************************************************************************/
      41                 : /*                           ~OGRGFTDriver()                            */
      42                 : /************************************************************************/
      43                 : 
      44             169 : OGRGFTDriver::~OGRGFTDriver()
      45                 : 
      46                 : {
      47             169 : }
      48                 : 
      49                 : /************************************************************************/
      50                 : /*                              GetName()                               */
      51                 : /************************************************************************/
      52                 : 
      53           10004 : const char *OGRGFTDriver::GetName()
      54                 : 
      55                 : {
      56           10004 :     return "GFT";
      57                 : }
      58                 : 
      59                 : /************************************************************************/
      60                 : /*                                Open()                                */
      61                 : /************************************************************************/
      62                 : 
      63              61 : OGRDataSource *OGRGFTDriver::Open( const char * pszFilename, int bUpdate )
      64                 : 
      65                 : {
      66              61 :     OGRGFTDataSource   *poDS = new OGRGFTDataSource();
      67                 : 
      68              61 :     if( !poDS->Open( pszFilename, bUpdate ) )
      69                 :     {
      70              53 :         delete poDS;
      71              53 :         poDS = NULL;
      72                 :     }
      73                 : 
      74              61 :     return poDS;
      75                 : }
      76                 : 
      77                 : 
      78                 : /************************************************************************/
      79                 : /*                          CreateDataSource()                          */
      80                 : /************************************************************************/
      81                 : 
      82               0 : OGRDataSource *OGRGFTDriver::CreateDataSource( const char * pszName,
      83                 :                                                char **papszOptions )
      84                 : 
      85                 : {
      86               0 :     OGRGFTDataSource   *poDS = new OGRGFTDataSource();
      87                 : 
      88               0 :     if( !poDS->Open( pszName, TRUE ) )
      89                 :     {
      90               0 :         delete poDS;
      91               0 :         poDS = NULL;
      92                 :     }
      93                 : 
      94               0 :     return poDS;
      95                 : }
      96                 : 
      97                 : /************************************************************************/
      98                 : /*                           TestCapability()                           */
      99                 : /************************************************************************/
     100                 : 
     101               0 : int OGRGFTDriver::TestCapability( const char * pszCap )
     102                 : 
     103                 : {
     104               0 :     if (EQUAL(pszCap, ODrCCreateDataSource))
     105               0 :         return TRUE;
     106                 : 
     107               0 :     return FALSE;
     108                 : }
     109                 : 
     110                 : /************************************************************************/
     111                 : /*                           RegisterOGRGFT()                           */
     112                 : /************************************************************************/
     113                 : 
     114             178 : void RegisterOGRGFT()
     115                 : 
     116                 : {
     117             178 :     OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( new OGRGFTDriver );
     118             178 : }
     119                 : 

Generated by: LCOV version 1.7