LCOV - code coverage report
Current view: directory - ogr/ogrsf_frmts/pcidsk - ogr_pcidsk.h (source / functions) Found Hit Coverage
Test: gdal_filtered.info Lines: 4 4 100.0 %
Date: 2012-04-28 Functions: 4 4 100.0 %

       1                 : /******************************************************************************
       2                 :  * $Id: ogr_csv.h 17495 2009-08-02 11:44:13Z rouault $
       3                 :  *
       4                 :  * Project:  PCIDSK Translator
       5                 :  * Purpose:  Definition of classes for PCIDSK vector segment driver.
       6                 :  * Author:   Frank Warmerdam, warmerdam@pobox.com
       7                 :  *
       8                 :  ******************************************************************************
       9                 :  * Copyright (c) 2009,  Frank Warmerdam
      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                 : #ifndef _OGR_PCIDSK_H_INCLUDED
      31                 : #define _OGR_PCIDSK_H_INCLUDED
      32                 : 
      33                 : #include "ogrsf_frmts.h"
      34                 : #include "pcidsk.h"
      35                 : #include "pcidsk_vectorsegment.h"
      36                 : 
      37                 : class OGRPCIDSKDataSource;
      38                 : 
      39                 : /************************************************************************/
      40                 : /*                             OGRPCIDSKLayer                              */
      41                 : /************************************************************************/
      42                 : 
      43                 : class OGRPCIDSKLayer : public OGRLayer
      44                 : {
      45                 :     PCIDSK::PCIDSKVectorSegment *poVecSeg;
      46                 :     PCIDSK::PCIDSKSegment       *poSeg;
      47                 : 
      48                 :     OGRFeatureDefn     *poFeatureDefn;
      49                 : 
      50                 :     OGRFeature *        GetNextUnfilteredFeature();
      51                 : 
      52                 :     int                 iRingStartField;
      53                 :     PCIDSK::ShapeId     hLastShapeId;
      54                 : 
      55                 :     bool                bUpdateAccess;
      56                 : 
      57                 :     OGRSpatialReference *poSRS;
      58                 : 
      59                 :   public:
      60                 :     OGRPCIDSKLayer( PCIDSK::PCIDSKSegment*, bool bUpdate );
      61                 :     ~OGRPCIDSKLayer();
      62                 : 
      63                 :     void                ResetReading();
      64                 :     OGRFeature *        GetNextFeature();
      65                 :     OGRFeature         *GetFeature( long nFeatureId );
      66                 :     OGRErr              SetFeature( OGRFeature *poFeature );
      67                 : 
      68             582 :     OGRFeatureDefn *    GetLayerDefn() { return poFeatureDefn; }
      69                 : 
      70                 :     int                 TestCapability( const char * );
      71                 : 
      72                 :     OGRErr              DeleteFeature( long nFID );
      73                 :     OGRErr              CreateFeature( OGRFeature *poFeature );
      74                 :     virtual OGRErr      CreateField( OGRFieldDefn *poField,
      75                 :                                      int bApproxOK = TRUE );
      76                 : 
      77                 :     virtual OGRSpatialReference *GetSpatialRef();
      78                 :     int                 GetFeatureCount( int );
      79                 :     OGRErr              GetExtent( OGREnvelope *psExtent, int bForce );
      80                 : };
      81                 : 
      82                 : /************************************************************************/
      83                 : /*                           OGRPCIDSKDataSource                           */
      84                 : /************************************************************************/
      85                 : 
      86                 : class OGRPCIDSKDataSource : public OGRDataSource
      87                 : {
      88                 :     CPLString           osName;
      89                 : 
      90                 :     std::vector<OGRPCIDSKLayer*> apoLayers;
      91                 : 
      92                 :     bool                bUpdate;
      93                 : 
      94                 :     PCIDSK::PCIDSKFile  *poFile;
      95                 :     
      96                 :   public:
      97                 :                         OGRPCIDSKDataSource();
      98                 :                         ~OGRPCIDSKDataSource();
      99                 : 
     100                 :     int                 Open( const char * pszFilename, int bUpdate);
     101                 :     
     102              14 :     const char          *GetName() { return osName; }
     103                 : 
     104             198 :     int                 GetLayerCount() { return (int) apoLayers.size(); }
     105                 :     OGRLayer            *GetLayer( int );
     106                 : 
     107                 :     int                 TestCapability( const char * );
     108                 : 
     109                 :     OGRLayer           *CreateLayer( const char *, OGRSpatialReference *,
     110                 :                                      OGRwkbGeometryType, char ** );
     111                 : };
     112                 : 
     113                 : /************************************************************************/
     114                 : /*                           OGRPCIDSKDriver                            */
     115                 : /************************************************************************/
     116                 : 
     117                 : class OGRPCIDSKDriver : public OGRSFDriver
     118             389 : {
     119                 :   public:
     120                 :                 ~OGRPCIDSKDriver();
     121                 :                 
     122                 :     const char *GetName();
     123                 :     OGRDataSource *Open( const char *, int );
     124                 :     OGRDataSource *CreateDataSource( const char *pszName, 
     125                 :                                      char **papszOptions );
     126                 :     int         TestCapability( const char * );
     127                 : };
     128                 : 
     129                 : 
     130                 : #endif /* ndef _OGR_PCIDSK_H_INCLUDED */

Generated by: LCOV version 1.7