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);
112 GDALProgressFunc pfnProgress,
127 OpenCallback pfnOpen =
nullptr;
129 virtual OpenCallback GetOpenCallback()
134 typedef GDALDataset *(*CreateCallback)(
const char *pszName,
int nXSize,
135 int nYSize,
int nBands,
137 char **papszOptions);
139 CreateCallback pfnCreate =
nullptr;
141 virtual CreateCallback GetCreateCallback()
146 GDALDataset *(*pfnCreateEx)(GDALDriver *,
const char *pszName,
int nXSize,
148 char **papszOptions) =
nullptr;
150 typedef GDALDataset *(*CreateMultiDimensionalCallback)(
151 const char *pszName,
CSLConstList papszRootGroupOptions,
154 CreateMultiDimensionalCallback pfnCreateMultiDimensional =
nullptr;
156 virtual CreateMultiDimensionalCallback GetCreateMultiDimensionalCallback()
158 return pfnCreateMultiDimensional;
161 typedef CPLErr (*DeleteCallback)(
const char *pszName);
162 DeleteCallback pfnDelete =
nullptr;
164 virtual DeleteCallback GetDeleteCallback()
171 GDALProgressFunc pfnProgress,
172 void *pProgressData);
174 CreateCopyCallback pfnCreateCopy =
nullptr;
176 virtual CreateCopyCallback GetCreateCopyCallback()
178 return pfnCreateCopy;
181 void *pDriverData =
nullptr;
183 void (*pfnUnloadDriver)(GDALDriver *) =
nullptr;
194 int (*pfnIdentifyEx)(GDALDriver *,
GDALOpenInfo *) =
nullptr;
196 typedef CPLErr (*RenameCallback)(
const char *pszNewName,
197 const char *pszOldName);
198 RenameCallback pfnRename =
nullptr;
200 virtual RenameCallback GetRenameCallback()
205 typedef CPLErr (*CopyFilesCallback)(
const char *pszNewName,
206 const char *pszOldName);
207 CopyFilesCallback pfnCopyFiles =
nullptr;
209 virtual CopyFilesCallback GetCopyFilesCallback()
219 GDALDataset *(*pfnCreateVectorOnly)(GDALDriver *,
const char *pszName,
220 char **papszOptions) =
nullptr;
221 CPLErr (*pfnDeleteDataSource)(GDALDriver *,
const char *pszName) =
nullptr;
227 bool (*pfnCanVectorTranslateFrom)(
230 char ***ppapszFailureReasons) =
nullptr;
239 GDALProgressFunc pfnProgress,
void *pProgressData) =
nullptr;
249 const std::vector<std::string> &aosPath);
250 InstantiateAlgorithmCallback pfnInstantiateAlgorithm =
nullptr;
252 virtual InstantiateAlgorithmCallback GetInstantiateAlgorithmCallback()
254 return pfnInstantiateAlgorithm;
261 InstantiateAlgorithm(
const std::vector<std::string> &aosPath);
266 void DeclareAlgorithm(
const std::vector<std::string> &aosPath);
276 GDALProgressFunc pfnProgress,
279 static CPLErr DefaultCreateCopyMultiDimensional(
282 void *pProgressData);
288 GDALProgressFunc pfnProgress,
289 void *pProgressData);
291 CPLErr QuietDeleteForCreateCopy(
const char *pszFilename,
299 static CPLErr DefaultRename(
const char *pszNewName,
const char *pszOldName);
300 static CPLErr DefaultCopyFiles(
const char *pszNewName,
301 const char *pszOldName);
319 return static_cast<GDALDriver *
>(hDriver);
329#ifdef PLUGIN_FILENAME
330#define PLUGIN_SYMBOL_NAME(x) GDAL_core_##x
332#define PLUGIN_SYMBOL_NAME(x) GDAL_driver_##x
GDAL algorithm.
Definition gdalalgorithm_cpp.h:2261
A set of associated raster bands, usually from one file.
Definition gdal_dataset.h:76
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:1186
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:317
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:1525
CPLErr CopyFiles(const char *pszNewName, const char *pszOldName)
Copy the files of a dataset.
Definition gdaldriver.cpp:2050
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:1482
CPLErr Delete(const char *pszName)
Delete named dataset.
Definition gdaldriver.cpp:1663
static CPLErr QuietDelete(const char *pszName, CSLConstList papszAllowedDrivers=nullptr)
Delete dataset if found.
Definition gdaldriver.cpp:1567
CPLErr Rename(const char *pszNewName, const char *pszOldName)
Rename a dataset.
Definition gdaldriver.cpp:1903
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:1445
static GDALDriverH ToHandle(GDALDriver *poDriver)
Convert a GDALDriver* to a GDALDriverH.
Definition gdal_driver.h:310
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:28
CPLErr
Error category.
Definition cpl_error.h:37
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:936
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:870
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