1 : /******************************************************************************
2 : * $Id: ogrogdidriver.cpp 16861 2009-04-26 19:22:29Z rouault $
3 : *
4 : * Project: OGDI Bridge
5 : * Purpose: Implements OGROGDIDriver class.
6 : * Author: Daniel Morissette, danmo@videotron.ca
7 : * (Based on some code contributed by Frank Warmerdam :)
8 : *
9 : ******************************************************************************
10 : * Copyright (c) 2000, Daniel Morissette
11 : *
12 : * Permission is hereby granted, free of charge, to any person obtaining a
13 : * copy of this software and associated documentation files (the "Software"),
14 : * to deal in the Software without restriction, including without limitation
15 : * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 : * and/or sell copies of the Software, and to permit persons to whom the
17 : * Software is furnished to do so, subject to the following conditions:
18 : *
19 : * The above copyright notice and this permission notice shall be included
20 : * in all copies or substantial portions of the Software.
21 : *
22 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 : * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 : * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 : * DEALINGS IN THE SOFTWARE.
29 : ****************************************************************************/
30 :
31 : #include "ogrogdi.h"
32 : #include "cpl_conv.h"
33 :
34 : CPL_CVSID("$Id: ogrogdidriver.cpp 16861 2009-04-26 19:22:29Z rouault $");
35 :
36 : /************************************************************************/
37 : /* ~OGROGDIDriver() */
38 : /************************************************************************/
39 :
40 369 : OGROGDIDriver::~OGROGDIDriver()
41 :
42 : {
43 369 : }
44 :
45 : /************************************************************************/
46 : /* GetName() */
47 : /************************************************************************/
48 :
49 23579 : const char *OGROGDIDriver::GetName()
50 :
51 : {
52 23579 : return "OGDI";
53 : }
54 :
55 : /************************************************************************/
56 : /* Open() */
57 : /************************************************************************/
58 :
59 586 : OGRDataSource *OGROGDIDriver::Open( const char * pszFilename,
60 : int bUpdate )
61 :
62 : {
63 : OGROGDIDataSource *poDS;
64 :
65 586 : poDS = new OGROGDIDataSource();
66 :
67 586 : if( !poDS->Open( pszFilename, TRUE ) )
68 : {
69 576 : delete poDS;
70 576 : poDS = NULL;
71 : }
72 :
73 586 : if ( poDS != NULL && bUpdate )
74 : {
75 : CPLError( CE_Failure, CPLE_OpenFailed,
76 0 : "OGDI Driver doesn't support update." );
77 0 : delete poDS;
78 0 : poDS = NULL;
79 : }
80 :
81 586 : return poDS;
82 : }
83 :
84 :
85 : /************************************************************************/
86 : /* TestCapability() */
87 : /************************************************************************/
88 :
89 0 : int OGROGDIDriver::TestCapability( const char * pszCap )
90 :
91 : {
92 0 : return FALSE;
93 : }
94 :
95 : /************************************************************************/
96 : /* RegisterOGROGDI() */
97 : /************************************************************************/
98 :
99 389 : void RegisterOGROGDI()
100 :
101 : {
102 389 : if (! GDAL_CHECK_VERSION("OGR/OGDI driver"))
103 0 : return;
104 389 : OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( new OGROGDIDriver );
105 : }
106 :
|