A registry / canonical manager of data providers.
This is a Singleton class that manages data provider access.
Loaded providers may be restricted using QGIS_PROVIDER_FILE environment variable. QGIS_PROVIDER_FILE is regexp pattern applied to provider file name (not provider key). For example, if the variable is set to gdal|ogr|postgres it will load only providers gdal, ogr and postgres.
Definition at line 45 of file qgsproviderregistry.h.
Open the given vector data source.
Similar to open(QString const &), except that the user specifies a data provider with which to open the data source instead of using the default data provider that QgsDataManager would figure out to use. This should be useful when (and if) there will exist more than one data provider that can handle a given data source. (E.g., use GDAL to open an SDTS file, or a different data provider that uses sdts++.)
Called by QgsDataManager::open().
|name||could be a file, URI |
|provider||is the key for the dataprovider used to open name |
- NULL if unable to open vector data source
Temporarily always returns false until finished implementing.
Eventually would be nice if could make QgsDataManager smart enough to figure out whether the given name mapped to a vector, raster, or database source.Type for data provider metadata associative container
Definition at line 169 of file qgsproviderregistry.h.
Return raster file filter string.
Returns a string suitable for a QFileDialog of raster file formats supported by all data providers.
This walks through all data providers appending calls to their buildSupportedRasterFileFilter to a string, which is then returned.
- This replaces QgsRasterLayer::buildSupportedRasterFileFilter()
Definition at line 500 of file qgsproviderregistry.cpp.
Return vector file filter string.
Returns a string suitable for a QFileDialog of vector file formats supported by all data providers.
This walks through all data providers appending calls to their fileVectorFilters to a string, which is then returned.
It'd be nice to eventually be raster/vector neutral.
Definition at line 495 of file qgsproviderregistry.cpp.
Create an instance of the provider.
Copied from QgsVectorLayer::setDataProvider TODO: Make it work in the generic environment.
|providerKey||identificator of the provider |
|dataSource||string containing data source for the provider |
- instance of provider or NULL on error
TODO: Is this class really the best place to put a data provider loader? It seems more sensible to provide the code in one place rather than in qgsrasterlayer, qgsvectorlayer, serversourceselect, etc.
Definition at line 340 of file qgsproviderregistry.cpp.