15#ifndef GDALDRIVERMANAGER_H_INCLUDED
16#define GDALDRIVERMANAGER_H_INCLUDED
21#include "gdal_majorobject.h"
45 std::map<CPLString, GDALDriver *> oMapNameToDrivers{};
46 std::string m_osPluginPath{};
47 std::string m_osDriversIniPath{};
48 mutable std::string m_osLastTriedDirectory{};
49 std::set<std::string> m_oSetPluginFileNames{};
50 bool m_bInDeferredDriverLoading =
false;
51 std::map<std::string, std::unique_ptr<GDALDriver>> m_oMapRealDrivers{};
52 std::vector<std::unique_ptr<GDALDriver>> m_aoHiddenDrivers{};
56 return (iDriver >= 0 && iDriver < nDrivers) ? papoDrivers[iDriver]
60 GDALDriver *GetDriverByName_unlocked(
const char *pszName)
const;
62 static void CleanupPythonDrivers();
64 std::string GetPluginFullPath(
const char *pszFilename)
const;
66 int RegisterDriver(
GDALDriver *,
bool bHidden);
71 friend class GDALPluginDriverProxy;
73 GDALOpenEx(
const char *pszFilename,
unsigned int nOpenFlags,
74 const char *
const *papszAllowedDrivers,
75 const char *
const *papszOpenOptions,
76 const char *
const *papszSiblingFiles);
79 static char **GetSearchPaths(
const char *pszGDAL_DRIVER_PATH);
84 ~GDALDriverManager()
override;
106 bool IsKnownDriver(
const char *pszDriverName)
const;
107 GDALDriver *GetHiddenDriverByName(
const char *pszName);
Class for managing the registration of file format drivers.
Definition gdal_drivermanager.h:42
void DeregisterDriver(GDALDriver *)
Deregister the passed driver.
Definition gdaldrivermanager.cpp:673
int GetDriverCount(void) const
Fetch the number of registered drivers.
Definition gdaldrivermanager.cpp:344
static CPLErr LoadPlugin(const char *name)
Load a single GDAL driver/plugin from shared libraries.
Definition gdaldrivermanager.cpp:914
static void AutoLoadPythonDrivers()
Auto-load GDAL drivers from Python scripts.
Definition gdalpythondriverloader.cpp:1915
void AutoSkipDrivers()
This method unload undesirable drivers.
Definition gdaldrivermanager.cpp:786
void AutoLoadDrivers()
Auto-load GDAL drivers from shared libraries.
Definition gdaldrivermanager.cpp:1036
void DeclareDeferredPluginDriver(GDALPluginDriverProxy *poProxyDriver)
Declare a driver that will be loaded as a plugin, when actually needed.
Definition gdaldrivermanager.cpp:1713
GDALDriver * GetDriverByName(const char *)
Fetch a driver based on the short name.
Definition gdaldrivermanager.cpp:731
GDALDriver * GetDriver(int)
Fetch driver by index.
Definition gdaldrivermanager.cpp:429
void ReorderDrivers()
Reorder drivers according to the order of the drivers.ini file.
Definition gdaldrivermanager.cpp:1181
Format specific driver.
Definition gdal_driver.h:63
GDALMajorObject(const GDALMajorObject &)=default
Copy constructor.
Proxy for a plugin driver.
Definition gdalplugindriverproxy.h:67
CPLErr
Error category.
Definition cpl_error.h:37
Core portability definitions for CPL.
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
#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
Various convenience functions for working with strings and string lists.
Public (C callable) GDAL entry points.
GDALDatasetH GDALOpenEx(const char *pszFilename, unsigned int nOpenFlags, const char *const *papszAllowedDrivers, const char *const *papszOpenOptions, const char *const *papszSiblingFiles)
Open a raster or vector file as a GDALDataset.
Definition gdaldataset.cpp:3914
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition gdal_fwd.h:42