OGRDataSource *OGRDGNDriver::Open( const char * pszFilename, int bUpdate ) { OGRDGNDataSource *poDS; poDS = new OGRDGNDataSource(); if( !poDS->Open( pszFilename, TRUE, bUpdate ) || poDS->GetLayerCount() == 0 ) { delete poDS; return NULL; } else return poDS; }
static GDALDataset *OGRDGNDriverOpen( GDALOpenInfo* poOpenInfo ) { if( !OGRDGNDriverIdentify(poOpenInfo) ) return NULL; OGRDGNDataSource *poDS = new OGRDGNDataSource(); if( !poDS->Open( poOpenInfo->pszFilename, TRUE, (poOpenInfo->eAccess == GA_Update) ) || poDS->GetLayerCount() == 0 ) { delete poDS; return NULL; } return poDS; }