OGRSFDriver Class Reference

#include <ogrsf_frmts.h>

List of all members.

Public Member Functions

virtual const char * GetName ()=0
virtual OGRDataSourceOpen (const char *pszName, int bUpdate=FALSE)=0
virtual int TestCapability (const char *)=0
virtual OGRDataSourceCreateDataSource (const char *pszName, char **=NULL)
virtual OGRErr DeleteDataSource (const char *pszName)


Detailed Description

Represents an operational format driver.

One OGRSFDriver derived class will normally exist for each file format registered for use, regardless of whether a file has or will be opened. The list of available drivers is normally managed by the OGRSFDriverRegistrar.


Member Function Documentation

OGRDataSource * OGRSFDriver::CreateDataSource const char *  pszName,
char **  papszOptions = NULL
[virtual]
 

This method attempts to create a new data source based on the passed driver. The papszOptions argument can be used to control driver specific creation options. These options are normally documented in the format specific documentation.

This method is the same as the C function OGR_Dr_CreateDataSource().

Parameters:
pszName the name for the new data source.
papszOptions a StringList of name=value options. Options are driver specific, and driver information can be found at the following url: http://gdal.velocet.ca/projects/opengis/ogrhtml/ogr_formats.html
Returns:
NULL is returned on failure, or a new OGRDataSource on success.

OGRErr OGRSFDriver::DeleteDataSource const char *  pszDataSource  )  [virtual]
 

Destroy a datasource.

Destroy the named datasource. Normally it would be safest if the datasource was not open at the time.

Whether this is a supported operation on this driver case be tested using TestCapability() on ODrCDeleteDataSource.

This method is the same as the C function OGR_Dr_DeleteDataSource().

Parameters:
pszDataSource the name of the datasource to delete.
Returns:
OGRERR_NONE on success, and OGRERR_UNSUPPORTED_OPERATION if this is not supported by this driver.

const char * OGRSFDriver::GetName  )  [pure virtual]
 

Fetch name of driver (file format). This name should be relatively short (10-40 characters), and should reflect the underlying file format. For instance "ESRI Shapefile".

This method is the same as the C function OGR_Dr_GetName().

Returns:
driver name. This is an internal string and should not be modified or freed.

OGRDataSource * OGRSFDriver::Open const char *  pszName,
int  bUpdate = FALSE
[pure virtual]
 

Attempt to open file with this driver.

This method is what OGRSFDriverRegistrar uses to implement its Open() method. See it for more details.

This method is the same as the C function OGR_Dr_Open().

Parameters:
pszName the name of the file, or data source to try and open.
bUpdate TRUE if update access is required, otherwise FALSE (the default).
Returns:
NULL on error or if the pass name is not supported by this driver, otherwise a pointer to an OGRDataSource. This OGRDataSource should be closed by deleting the object when it is no longer needed.

int OGRSFDriver::TestCapability const char *  pszCapability  )  [pure virtual]
 

Test if capability is available.

One of the following data source capability names can be passed into this method, and a TRUE or FALSE value will be returned indicating whether or not the capability is available for this object.

  • ODrCCreateDataSource: True if this driver can support creating data sources.

  • ODrCDeleteDataSource: True if this driver supports deleting data sources.

The define macro forms of the capability names should be used in preference to the strings themselves to avoid mispelling.

This method is the same as the C function OGR_Dr_TestCapability().

Parameters:
pszCapability the capability to test.
Returns:
TRUE if capability available otherwise FALSE.


The documentation for this class was generated from the following files:
Generated on Mon Jan 9 18:03:32 2006 for OGR by  doxygen 1.4.6