Line data Source code
1 : /********************************************************************** 2 : * 3 : * Name: mitab_ogr_drive.h 4 : * Project: Mid/mif tab ogr support 5 : * Language: C++ 6 : * Purpose: Header file containing public definitions for the library. 7 : * Author: Stephane Villeneuve, stephane.v@videotron.ca 8 : * 9 : ********************************************************************** 10 : * Copyright (c) 1999, 2000, Stephane Villeneuve 11 : * Copyright (c) 2014, Even Rouault <even.rouault at spatialys.com> 12 : * 13 : * SPDX-License-Identifier: MIT 14 : **********************************************************************/ 15 : 16 : #include "mitab.h" 17 : #include "ogrsf_frmts.h" 18 : 19 : #ifndef MITAB_OGR_DRIVER_H_INCLUDED_ 20 : #define MITAB_OGR_DRIVER_H_INCLUDED_ 21 : 22 : /*===================================================================== 23 : * OGRTABDataSource Class 24 : * 25 : * These classes handle all the file types supported by the MITAB lib. 26 : * through the IMapInfoFile interface. 27 : *====================================================================*/ 28 : class OGRTABDataSource final : public GDALDataset 29 : { 30 : CPL_DISALLOW_COPY_ASSIGN(OGRTABDataSource) 31 : 32 : private: 33 : char *m_pszDirectory; 34 : 35 : int m_nLayerCount; 36 : IMapInfoFile **m_papoLayers; 37 : 38 : char **m_papszOptions; 39 : int m_bCreateMIF; 40 : int m_bSingleFile; 41 : int m_bSingleLayerAlreadyCreated; 42 : GBool m_bQuickSpatialIndexMode; 43 : int m_nBlockSize; 44 : 45 : private: 46 2430 : inline bool GetUpdate() const 47 : { 48 2430 : return eAccess == GA_Update; 49 : } 50 : 51 : public: 52 : OGRTABDataSource(); 53 : ~OGRTABDataSource() override; 54 : 55 : int Open(GDALOpenInfo *poOpenInfo, int bTestOpen); 56 : int Create(const char *pszName, char **papszOptions); 57 : 58 : int GetLayerCount() const override; 59 : const OGRLayer *GetLayer(int) const override; 60 : int TestCapability(const char *) const override; 61 : 62 : OGRLayer *ICreateLayer(const char *pszName, 63 : const OGRGeomFieldDefn *poGeomFieldDefn, 64 : CSLConstList papszOptions) override; 65 : 66 : char **GetFileList() override; 67 : 68 : OGRLayer *ExecuteSQL(const char *pszStatement, OGRGeometry *poSpatialFilter, 69 : const char *pszDialect) override; 70 : }; 71 : 72 : void CPL_DLL RegisterOGRTAB(); 73 : 74 : #endif /* MITAB_OGR_DRIVER_H_INCLUDED_ */