15#ifndef GDALDRIVER_H_INCLUDED
16#define GDALDRIVER_H_INCLUDED
20#include "gdal_majorobject.h"
40 GDAL_IDENTIFY_UNKNOWN = -1,
42 GDAL_IDENTIFY_FALSE = 0,
44 GDAL_IDENTIFY_TRUE = 1
66 ~GDALDriver()
override;
69 const char *pszDomain =
"")
override;
72 const char *pszDomain =
"")
override;
88 CPLErr Rename(
const char *pszNewName,
const char *pszOldName);
93 GDALProgressFunc pfnProgress,
99 char ***ppapszFailureReasons);
120 GDALProgressFunc pfnProgress,
135 OpenCallback pfnOpen =
nullptr;
137 virtual OpenCallback GetOpenCallback()
142 typedef GDALDataset *(*CreateCallback)(
const char *pszName,
int nXSize,
143 int nYSize,
int nBands,
147 CreateCallback pfnCreate =
nullptr;
149 virtual CreateCallback GetCreateCallback()
154 GDALDataset *(*pfnCreateEx)(GDALDriver *,
const char *pszName,
int nXSize,
158 typedef GDALDataset *(*CreateMultiDimensionalCallback)(
159 const char *pszName,
CSLConstList papszRootGroupOptions,
162 CreateMultiDimensionalCallback pfnCreateMultiDimensional =
nullptr;
164 virtual CreateMultiDimensionalCallback GetCreateMultiDimensionalCallback()
166 return pfnCreateMultiDimensional;
169 typedef CPLErr (*DeleteCallback)(
const char *pszName);
170 DeleteCallback pfnDelete =
nullptr;
172 virtual DeleteCallback GetDeleteCallback()
179 GDALProgressFunc pfnProgress,
180 void *pProgressData);
182 CreateCopyCallback pfnCreateCopy =
nullptr;
184 virtual CreateCopyCallback GetCreateCopyCallback()
186 return pfnCreateCopy;
189 void *pDriverData =
nullptr;
191 void (*pfnUnloadDriver)(GDALDriver *) =
nullptr;
202 int (*pfnIdentifyEx)(GDALDriver *,
GDALOpenInfo *) =
nullptr;
204 typedef CPLErr (*RenameCallback)(
const char *pszNewName,
205 const char *pszOldName);
206 RenameCallback pfnRename =
nullptr;
208 virtual RenameCallback GetRenameCallback()
213 typedef CPLErr (*CopyFilesCallback)(
const char *pszNewName,
214 const char *pszOldName);
215 CopyFilesCallback pfnCopyFiles =
nullptr;
217 virtual CopyFilesCallback GetCopyFilesCallback()
227 GDALDataset *(*pfnCreateVectorOnly)(GDALDriver *,
const char *pszName,
229 CPLErr (*pfnDeleteDataSource)(GDALDriver *,
const char *pszName) =
nullptr;
235 bool (*pfnCanVectorTranslateFrom)(
238 char ***ppapszFailureReasons) =
nullptr;
247 GDALProgressFunc pfnProgress,
void *pProgressData) =
nullptr;
257 const std::vector<std::string> &aosPath);
258 InstantiateAlgorithmCallback pfnInstantiateAlgorithm =
nullptr;
260 virtual InstantiateAlgorithmCallback GetInstantiateAlgorithmCallback()
262 return pfnInstantiateAlgorithm;
269 InstantiateAlgorithm(
const std::vector<std::string> &aosPath);
274 void DeclareAlgorithm(
const std::vector<std::string> &aosPath);
279 void (*pfnClearCaches)(GDALDriver *) =
nullptr;
289 GDALProgressFunc pfnProgress,
292 static CPLErr DefaultCreateCopyMultiDimensional(
295 void *pProgressData);
301 GDALProgressFunc pfnProgress,
302 void *pProgressData);
304 CPLErr QuietDeleteForCreateCopy(
const char *pszFilename,
312 static CPLErr DefaultRename(
const char *pszNewName,
const char *pszOldName);
313 static CPLErr DefaultCopyFiles(
const char *pszNewName,
314 const char *pszOldName);
332 return static_cast<GDALDriver *
>(hDriver);
342#ifdef PLUGIN_FILENAME
343#define PLUGIN_SYMBOL_NAME(x) GDAL_core_##x
345#define PLUGIN_SYMBOL_NAME(x) GDAL_driver_##x
GDAL algorithm.
Definition gdalalgorithm_cpp.h:2445
A set of associated raster bands, usually from one file.
Definition gdal_dataset.h:77
Format specific driver.
Definition gdal_driver.h:63
GDALDataset * CreateCopy(const char *, GDALDataset *, int, CSLConstList papszOptions, GDALProgressFunc pfnProgress, void *pProgressData)
Create a copy of a dataset.
Definition gdaldriver.cpp:1188
GDALDataset * Create(const char *pszName, int nXSize, int nYSize, int nBands, GDALDataType eType, CSLConstList papszOptions)
Create a new dataset with this driver.
Definition gdaldriver.cpp:193
static GDALDriver * FromHandle(GDALDriverH hDriver)
Convert a GDALDriverH to a GDALDriver*.
Definition gdal_driver.h:330
GDALDataset * VectorTranslateFrom(const char *pszDestName, GDALDataset *poSourceDS, CSLConstList papszVectorTranslateArguments, GDALProgressFunc pfnProgress, void *pProgressData)
Create a copy of a vector dataset, using the arguments passed to GDALVectorTranslate() stored in paps...
Definition gdaldriver.cpp:1557
CPLErr CopyFiles(const char *pszNewName, const char *pszOldName)
Copy the files of a dataset.
Definition gdaldriver.cpp:2083
GDALDataset * CreateMultiDimensional(const char *pszName, CSLConstList papszRootGroupOptions, CSLConstList papszOptions)
Create a new multidimensional dataset with this driver.
Definition gdaldriver.cpp:367
bool HasOpenOption(const char *pszOpenOptionName) const
Returns TRUE if the given open option is supported by the driver.
Definition gdaldriver.cpp:1488
CPLErr Delete(const char *pszName)
Delete named dataset.
Definition gdaldriver.cpp:1695
static CPLErr QuietDelete(const char *pszName, CSLConstList papszAllowedDrivers=nullptr)
Delete dataset if found.
Definition gdaldriver.cpp:1599
bool HasLayerCreationOption(const char *pszOptionName) const
Returns TRUE if the given layer creation option is supported by the driver.
Definition gdaldriver.cpp:1514
CPLErr Rename(const char *pszNewName, const char *pszOldName)
Rename a dataset.
Definition gdaldriver.cpp:1936
bool CanVectorTranslateFrom(const char *pszDestName, GDALDataset *poSourceDS, CSLConstList papszVectorTranslateArguments, char ***ppapszFailureReasons)
Returns whether the driver can translate from a vector dataset, using the arguments passed to GDALVec...
Definition gdaldriver.cpp:1447
static GDALDriverH ToHandle(GDALDriver *poDriver)
Convert a GDALDriver* to a GDALDriverH.
Definition gdal_driver.h:323
GDALMajorObject(const GDALMajorObject &)=default
Copy constructor.
virtual CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="")
Set single metadata item.
Definition gdalmajorobject.cpp:366
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition gdalmajorobject.cpp:322
Class for dataset open functions.
Definition gdal_openinfo.h:30
CPLErr
Error category / error level.
Definition cpl_error.h:45
Core portability definitions for CPL.
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:1101
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1252
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:1035
Public (C callable) GDAL entry points.
GDALDataType
Definition gdal.h:48
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition gdal_fwd.h:51
The GDALSubdatasetInfo abstract class provides methods to extract and manipulate subdataset informati...
Definition gdalsubdatasetinfo.h:27