1 : /******************************************************************************
2 : * $Id: ogrsvgdriver.cpp 22110 2011-04-03 19:05:10Z rouault $
3 : *
4 : * Project: SVG Translator
5 : * Purpose: Implements OGRSVGDriver.
6 : * Author: Even Rouault, even dot rouault at mines dash paris dot org
7 : *
8 : ******************************************************************************
9 : * Copyright (c) 2011, Even Rouault
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_svg.h"
31 : #include "cpl_conv.h"
32 :
33 : CPL_CVSID("$Id: ogrsvgdriver.cpp 22110 2011-04-03 19:05:10Z rouault $");
34 :
35 : CPL_C_START
36 : void RegisterOGRSVG();
37 : CPL_C_END
38 :
39 : // g++ -g -Wall -fPIC ogr/ogrsf_frmts/svg/*.c* -shared -o ogr_SVG.so -Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/svg -L. -lgdal -DHAVE_EXPAT
40 :
41 : /************************************************************************/
42 : /* ~OGRSVGDriver() */
43 : /************************************************************************/
44 :
45 169 : OGRSVGDriver::~OGRSVGDriver()
46 :
47 : {
48 169 : }
49 :
50 : /************************************************************************/
51 : /* GetName() */
52 : /************************************************************************/
53 :
54 9992 : const char *OGRSVGDriver::GetName()
55 :
56 : {
57 9992 : return "SVG";
58 : }
59 :
60 : /************************************************************************/
61 : /* Open() */
62 : /************************************************************************/
63 :
64 53 : OGRDataSource *OGRSVGDriver::Open( const char * pszFilename, int bUpdate )
65 :
66 : {
67 53 : if (bUpdate)
68 : {
69 5 : return NULL;
70 : }
71 :
72 48 : OGRSVGDataSource *poDS = new OGRSVGDataSource();
73 :
74 48 : if( !poDS->Open( pszFilename, bUpdate ) )
75 : {
76 47 : delete poDS;
77 47 : poDS = NULL;
78 : }
79 :
80 48 : return poDS;
81 : }
82 :
83 : /************************************************************************/
84 : /* TestCapability() */
85 : /************************************************************************/
86 :
87 0 : int OGRSVGDriver::TestCapability( const char *pszCap )
88 : {
89 0 : return FALSE;
90 : }
91 :
92 : /************************************************************************/
93 : /* RegisterOGRSVG() */
94 : /************************************************************************/
95 :
96 178 : void RegisterOGRSVG()
97 :
98 : {
99 178 : if (! GDAL_CHECK_VERSION("OGR/SVG driver"))
100 0 : return;
101 178 : OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( new OGRSVGDriver );
102 : }
103 :
|