Beispiel #1
0
/*
  \brief Open existing data source
  \return NULL on failure
*/
static GDALDataset *OGRVFKDriverOpen(GDALOpenInfo* poOpenInfo)
{
    if( poOpenInfo->eAccess == GA_Update ||
        !OGRVFKDriverIdentify(poOpenInfo) )
        return nullptr;

    OGRVFKDataSource *poDS = new OGRVFKDataSource();

    if( !poDS->Open(poOpenInfo) ||
        poDS->GetLayerCount() == 0 )
    {
        delete poDS;
        return nullptr;
    }
    else
        return poDS;
}
/*
  \brief Open existing data source
  \return NULL on failure
*/
static GDALDataset *OGRVFKDriverOpen(GDALOpenInfo* poOpenInfo)
{
    OGRVFKDataSource *poDS;

    if( poOpenInfo->eAccess == GA_Update ||
        !OGRVFKDriverIdentify(poOpenInfo) )
        return NULL;

    poDS = new OGRVFKDataSource();

    if(!poDS->Open(poOpenInfo->pszFilename, TRUE) || poDS->GetLayerCount() == 0) {
        delete poDS;
        return NULL;
    }
    else
        return poDS;
}