1 : /******************************************************************************
2 : * $Id: ogr_arcgen.h 23148 2011-10-01 11:55:08Z rouault $
3 : *
4 : * Project: Arc/Info Generate Translator
5 : * Purpose: Definition of classes for OGR .arcgen driver.
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, DAMARCGENS 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_ARCGEN_H_INCLUDED
31 : #define _OGR_ARCGEN_H_INCLUDED
32 :
33 : #include "ogrsf_frmts.h"
34 :
35 : /************************************************************************/
36 : /* OGRARCGENLayer */
37 : /************************************************************************/
38 :
39 : class OGRARCGENLayer : public OGRLayer
40 : {
41 : OGRFeatureDefn* poFeatureDefn;
42 :
43 : VSILFILE* fp;
44 : int bEOF;
45 :
46 : int nNextFID;
47 :
48 : OGRFeature * GetNextRawFeature();
49 :
50 : public:
51 : OGRARCGENLayer(const char* pszFilename,
52 : VSILFILE* fp, OGRwkbGeometryType eType);
53 : ~OGRARCGENLayer();
54 :
55 :
56 : virtual void ResetReading();
57 : virtual OGRFeature * GetNextFeature();
58 :
59 6 : virtual OGRFeatureDefn * GetLayerDefn() { return poFeatureDefn; }
60 :
61 : virtual int TestCapability( const char * );
62 :
63 0 : virtual OGRSpatialReference *GetSpatialRef() { return NULL; }
64 :
65 : };
66 :
67 : /************************************************************************/
68 : /* OGRARCGENDataSource */
69 : /************************************************************************/
70 :
71 : class OGRARCGENDataSource : public OGRDataSource
72 : {
73 : char* pszName;
74 :
75 : OGRLayer** papoLayers;
76 : int nLayers;
77 :
78 : public:
79 : OGRARCGENDataSource();
80 : ~OGRARCGENDataSource();
81 :
82 : int Open( const char * pszFilename,
83 : int bUpdate );
84 :
85 6 : virtual const char* GetName() { return pszName; }
86 :
87 2 : virtual int GetLayerCount() { return nLayers; }
88 : virtual OGRLayer* GetLayer( int );
89 :
90 : virtual int TestCapability( const char * );
91 : };
92 :
93 : /************************************************************************/
94 : /* OGRARCGENDriver */
95 : /************************************************************************/
96 :
97 : class OGRARCGENDriver : public OGRSFDriver
98 226 : {
99 : public:
100 : ~OGRARCGENDriver();
101 :
102 : virtual const char* GetName();
103 : virtual OGRDataSource* Open( const char *, int );
104 : virtual int TestCapability( const char * );
105 : };
106 :
107 :
108 : #endif /* ndef _OGR_ARCGEN_H_INCLUDED */
|