Skip to content

Commit

Permalink
ENH: CPLStringList * -> CPLStringList (from PR review)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmichel-otb committed Jul 7, 2016
1 parent f014748 commit 96ff920
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gdal/gcore/gdal_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ class CPL_DLL GDALDataset : public GDALMajorObject
OGRGeometry *poSpatialFilter,
const char *pszDialect,
swq_select_parse_options* poSelectParseOptions);
CPLStringList * papoDerivedMetadataList;
CPLStringList papoDerivedMetadataList;
public:

virtual int GetLayerCount();
Expand Down
12 changes: 4 additions & 8 deletions gdal/gcore/gdaldataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ void GDALDataset::Init(int bForceCachedIOIn)
bIsInternal = TRUE;
bSuppressOnClose = FALSE;
papszOpenOptions = NULL;
papoDerivedMetadataList = new CPLStringList();

/* -------------------------------------------------------------------- */
/* Set forced caching flag. */
Expand Down Expand Up @@ -330,9 +329,6 @@ GDALDataset::~GDALDataset()
CPLFree(psPrivate);

CSLDestroy( papszOpenOptions );

CPLFree(papoDerivedMetadataList);
papoDerivedMetadataList = NULL;
}

/************************************************************************/
Expand Down Expand Up @@ -3304,7 +3300,7 @@ char ** GDALDataset::GetMetadata(const char * pszDomain)
{
if( pszDomain != NULL && EQUAL(pszDomain, "DERIVED_SUBDATASETS") )
{
papoDerivedMetadataList->Clear();
papoDerivedMetadataList.Clear();



Expand All @@ -3314,14 +3310,14 @@ char ** GDALDataset::GetMetadata(const char * pszDomain)
CPLDebug("GDALDataset::GetMetadata","Number of derived datasets to report: %i",(int)NB_DERIVED_DATASETS);
for(unsigned int derivedId = 0; derivedId<NB_DERIVED_DATASETS;++derivedId)
{
papoDerivedMetadataList->SetNameValue(CPLSPrintf("DERIVED_SUBDATASET_%i_NAME",derivedId),CPLSPrintf("DERIVED_SUBDATASET:%s:%s",asDDSDesc[derivedId].pszDatasetName,GetDescription()));
papoDerivedMetadataList.SetNameValue(CPLSPrintf("DERIVED_SUBDATASET_%i_NAME",derivedId),CPLSPrintf("DERIVED_SUBDATASET:%s:%s",asDDSDesc[derivedId].pszDatasetName,GetDescription()));

CPLString osDesc(CPLSPrintf("%s from %s",asDDSDesc[derivedId].pszDatasetDescritpion,GetDescription()));
papoDerivedMetadataList->SetNameValue(CPLSPrintf("DERIVED_SUBDATASET_%i_DESC",derivedId),osDesc.c_str());
papoDerivedMetadataList.SetNameValue(CPLSPrintf("DERIVED_SUBDATASET_%i_DESC",derivedId),osDesc.c_str());
}
}

return papoDerivedMetadataList->List();
return papoDerivedMetadataList.List();
}
else
return GDALMajorObject::GetMetadata(pszDomain);
Expand Down

0 comments on commit 96ff920

Please sign in to comment.