static GDALDataset *OGRILI2DriverOpen( GDALOpenInfo* poOpenInfo ) { if( poOpenInfo->eAccess == GA_Update || (!poOpenInfo->bStatOK && strchr(poOpenInfo->pszFilename, ',') == NULL) ) return NULL; if( poOpenInfo->fpL != NULL ) { if( poOpenInfo->pabyHeader[0] != '<' || strstr((const char*)poOpenInfo->pabyHeader,"interlis.ch/INTERLIS2") == NULL ) { return NULL; } } else if( poOpenInfo->bIsDirectory ) return NULL; OGRILI2DataSource *poDS = new OGRILI2DataSource(); if( !poDS->Open( poOpenInfo->pszFilename, poOpenInfo->papszOpenOptions, TRUE ) || poDS->GetLayerCount() == 0 ) { delete poDS; return NULL; } return poDS; }
static GDALDataset *OGRILI2DriverCreate( const char * pszName, int /* nBands */, int /* nXSize */, int /* nYSize */, GDALDataType /* eDT */, char **papszOptions ) { OGRILI2DataSource *poDS = new OGRILI2DataSource(); if( !poDS->Create( pszName, papszOptions ) ) { delete poDS; return NULL; } return poDS; }
static GDALDataset *OGRILI2DriverCreate( const char * pszName, CPL_UNUSED int nBands, CPL_UNUSED int nXSize, CPL_UNUSED int nYSize, CPL_UNUSED GDALDataType eDT, char **papszOptions ) { OGRILI2DataSource *poDS = new OGRILI2DataSource(); if( !poDS->Create( pszName, papszOptions ) ) { delete poDS; return NULL; } else return poDS; }