static GDALDataset *OGRILI1DriverOpen( GDALOpenInfo* poOpenInfo ) { if( poOpenInfo->eAccess == GA_Update || (!poOpenInfo->bStatOK && strchr(poOpenInfo->pszFilename, ',') == NULL) ) return NULL; if( poOpenInfo->fpL != NULL ) { if( strstr((const char*)poOpenInfo->pabyHeader,"SCNT") == NULL ) { return NULL; } } else if( poOpenInfo->bIsDirectory ) return NULL; OGRILI1DataSource *poDS = new OGRILI1DataSource(); if( !poDS->Open( poOpenInfo->pszFilename, poOpenInfo->papszOpenOptions, TRUE ) || poDS->GetLayerCount() == 0 ) { delete poDS; return NULL; } return poDS; }
OGRDataSource *OGRILI1Driver::Open( const char * pszFilename, int bUpdate ) { OGRILI1DataSource *poDS; if( bUpdate ) return NULL; poDS = new OGRILI1DataSource(); if( !poDS->Open( pszFilename, TRUE ) || poDS->GetLayerCount() == 0 ) { delete poDS; return NULL; } else return poDS; }