1 : /******************************************************************************
2 : * $Id: ogrelasticdriver.cpp 23836 2012-01-31 19:32:04Z rouault $
3 : *
4 : * Project: ElasticSearch Translator
5 : * Purpose:
6 : * Author:
7 : *
8 : ******************************************************************************
9 : * Copyright (c) 2011, Adam Estrada
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_elastic.h"
31 : #include "cpl_conv.h"
32 :
33 : CPL_CVSID("$Id: ogrelasticdriver.cpp 23836 2012-01-31 19:32:04Z rouault $");
34 :
35 : /************************************************************************/
36 : /* ~OGRElasticDriver() */
37 : /************************************************************************/
38 :
39 214 : OGRElasticDriver::~OGRElasticDriver() {
40 214 : }
41 :
42 : /************************************************************************/
43 : /* GetName() */
44 : /************************************************************************/
45 :
46 13810 : const char *OGRElasticDriver::GetName() {
47 13810 : return "ElasticSearch";
48 : }
49 :
50 : /************************************************************************/
51 : /* Open() */
52 : /************************************************************************/
53 :
54 37 : OGRDataSource *OGRElasticDriver::Open(const char * pszFilename, int bUpdate) {
55 37 : return NULL;
56 : }
57 :
58 : /************************************************************************/
59 : /* CreateDataSource() */
60 : /************************************************************************/
61 :
62 2 : OGRDataSource *OGRElasticDriver::CreateDataSource(const char * pszName,
63 : char **papszOptions) {
64 2 : OGRElasticDataSource *poDS = new OGRElasticDataSource();
65 :
66 2 : if (!poDS->Create(pszName, papszOptions)) {
67 1 : delete poDS;
68 1 : poDS = NULL;
69 : }
70 :
71 2 : return poDS;
72 : }
73 :
74 : /************************************************************************/
75 : /* TestCapability() */
76 : /************************************************************************/
77 :
78 0 : int OGRElasticDriver::TestCapability(const char * pszCap) {
79 0 : if (EQUAL(pszCap, ODrCCreateDataSource))
80 0 : return TRUE;
81 : else
82 0 : return FALSE;
83 : }
84 :
85 : /************************************************************************/
86 : /* RegisterOGRElastic() */
87 : /************************************************************************/
88 :
89 226 : void RegisterOGRElastic() {
90 226 : if (!GDAL_CHECK_VERSION("OGR/Elastic Search driver"))
91 0 : return;
92 226 : OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver(new OGRElasticDriver);
93 : }
94 :
|