Skip to content

Commit afb12d7

Browse files
committed
Make GDALDataset::AddBand/AdviseRead/BeginAsyncReader/CopyLayer/pfnCreate/pfnCreateCopy, GDALRasterBand::AdviseRead/GetVirtualMemAuto virtual method take a a CSLConstList papszOptions parameter instead of char **
Impacts out-of-tree drivers Fixes OSGeo#13746
1 parent f2ccdca commit afb12d7

File tree

287 files changed

+844
-784
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

287 files changed

+844
-784
lines changed

autotest/cpp/test_gdal.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,14 +587,14 @@ class DatasetWithErrorInFlushCache final : public GDALDataset
587587
return CE_None;
588588
}
589589

590-
static GDALDataset *CreateCopy(const char *, GDALDataset *, int, char **,
591-
GDALProgressFunc, void *)
590+
static GDALDataset *CreateCopy(const char *, GDALDataset *, int,
591+
CSLConstList, GDALProgressFunc, void *)
592592
{
593593
return new DatasetWithErrorInFlushCache();
594594
}
595595

596596
static GDALDataset *Create(const char *, int nXSize, int nYSize, int,
597-
GDALDataType, char **)
597+
GDALDataType, CSLConstList)
598598
{
599599
DatasetWithErrorInFlushCache *poDS = new DatasetWithErrorInFlushCache();
600600
poDS->eAccess = GA_Update;

doc/source/user/migration_guide.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ From GDAL 3.12 to GDAL 3.13
1111

1212
* :cpp:func:`GDALDataset::Close` takes now 2 input parameters ``(GDALProgressFunc pfnProgress, void *pProgressData)``,
1313
which may be nullptr.
14+
* :cpp:func:`GDALDataset::AddBand`, :cpp:func:`GDALDataset::AdviseRead`,
15+
:cpp:func:`GDALDataset::BeginAsyncReader`, :cpp:func:`GDALDataset::CopyLayer`,
16+
``GDALDriver::pfnCreate``, ``GDALDriver::pfnCreateCopy``,
17+
:cpp:func:`GDALRasterBand::AdviseRead` and :cpp:func:`GDALRasterBand::GetVirtualMemAuto`
18+
now take a ``CSLConstList papszOptions`` parameter instead of ``char **``.
1419

1520
- Changes impacting C++ users:
1621

frmts/aaigrid/aaigriddataset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ const OGRSpatialReference *AAIGDataset::GetSpatialRef() const
12981298

12991299
GDALDataset *AAIGDataset::CreateCopy(const char *pszFilename,
13001300
GDALDataset *poSrcDS, int /* bStrict */,
1301-
char **papszOptions,
1301+
CSLConstList papszOptions,
13021302
GDALProgressFunc pfnProgress,
13031303
void *pProgressData)
13041304
{

frmts/aaigrid/aaigriddataset.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class AAIGDataset CPL_NON_FINAL : public GDALPamDataset
102102
static CPLErr Remove(const char *pszFilename, int bRepError);
103103
static GDALDataset *CreateCopy(const char *pszFilename,
104104
GDALDataset *poSrcDS, int bStrict,
105-
char **papszOptions,
105+
CSLConstList papszOptions,
106106
GDALProgressFunc pfnProgress,
107107
void *pProgressData);
108108

frmts/avif/avifdataset.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class GDALAVIFDataset final : public GDALPamDataset
8080
}
8181

8282
static GDALDataset *CreateCopy(const char *, GDALDataset *, int,
83-
char **papszOptions,
83+
CSLConstList papszOptions,
8484
GDALProgressFunc pfnProgress,
8585
void *pProgressData);
8686

@@ -699,11 +699,10 @@ GDALPamDataset *GDALAVIFDataset::OpenStaticPAM(GDALOpenInfo *poOpenInfo)
699699
/************************************************************************/
700700

701701
/* static */
702-
GDALDataset *GDALAVIFDataset::CreateCopy(const char *pszFilename,
703-
GDALDataset *poSrcDS,
704-
int /* bStrict */, char **papszOptions,
705-
GDALProgressFunc pfnProgress,
706-
void *pProgressData)
702+
GDALDataset *
703+
GDALAVIFDataset::CreateCopy(const char *pszFilename, GDALDataset *poSrcDS,
704+
int /* bStrict */, CSLConstList papszOptions,
705+
GDALProgressFunc pfnProgress, void *pProgressData)
707706
{
708707
auto poDrv = GetGDALDriverManager()->GetDriverByName(DRIVER_NAME);
709708
if (poDrv && poDrv->GetMetadataItem(GDAL_DMD_CREATIONOPTIONLIST) == nullptr)

frmts/basisu_ktx2/basisudataset.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class BASISUDataset final : public GDALPamDataset
5353
static GDALDataset *Open(GDALOpenInfo *poOpenInfo);
5454
static GDALDataset *CreateCopy(const char *pszFilename,
5555
GDALDataset *poSrcDS, int bStrict,
56-
char **papszOptions,
56+
CSLConstList papszOptions,
5757
GDALProgressFunc pfnProgress,
5858
void *pProgressData);
5959
};
@@ -360,7 +360,7 @@ GDALDataset *BASISUDataset::Open(GDALOpenInfo *poOpenInfo)
360360

361361
GDALDataset *BASISUDataset::CreateCopy(const char *pszFilename,
362362
GDALDataset *poSrcDS, int /*bStrict*/,
363-
char **papszOptions,
363+
CSLConstList papszOptions,
364364
GDALProgressFunc pfnProgress,
365365
void *pProgressData)
366366
{

frmts/basisu_ktx2/ktx2dataset.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class KTX2Dataset final : public GDALPamDataset
5151
static GDALDataset *Open(GDALOpenInfo *poOpenInfo);
5252
static GDALDataset *CreateCopy(const char *pszFilename,
5353
GDALDataset *poSrcDS, int bStrict,
54-
char **papszOptions,
54+
CSLConstList papszOptions,
5555
GDALProgressFunc pfnProgress,
5656
void *pProgressData);
5757
};
@@ -402,7 +402,7 @@ GDALDataset *KTX2Dataset::Open(GDALOpenInfo *poOpenInfo)
402402

403403
GDALDataset *KTX2Dataset::CreateCopy(const char *pszFilename,
404404
GDALDataset *poSrcDS, int /*bStrict*/,
405-
char **papszOptions,
405+
CSLConstList papszOptions,
406406
GDALProgressFunc pfnProgress,
407407
void *pProgressData)
408408
{

frmts/bmp/bmpdataset.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class BMPDataset final : public GDALPamDataset
247247
static GDALDataset *Open(GDALOpenInfo *);
248248
static GDALDataset *Create(const char *pszFilename, int nXSize, int nYSize,
249249
int nBandsIn, GDALDataType eType,
250-
char **papszParamList);
250+
CSLConstList papszParamList);
251251

252252
CPLErr GetGeoTransform(GDALGeoTransform &gt) const override;
253253
CPLErr SetGeoTransform(const GDALGeoTransform &gt) override;
@@ -1430,7 +1430,7 @@ GDALDataset *BMPDataset::Open(GDALOpenInfo *poOpenInfo)
14301430

14311431
GDALDataset *BMPDataset::Create(const char *pszFilename, int nXSize, int nYSize,
14321432
int nBandsIn, GDALDataType eType,
1433-
char **papszOptions)
1433+
CSLConstList papszOptions)
14341434

14351435
{
14361436
if (eType != GDT_UInt8)

frmts/cals/calsdataset.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class CALSDataset final : public GDALPamDataset
4646
static GDALDataset *Open(GDALOpenInfo *);
4747
static GDALDataset *CreateCopy(const char *pszFilename,
4848
GDALDataset *poSrcDS, int bStrict,
49-
char **papszOptions,
49+
CSLConstList papszOptions,
5050
GDALProgressFunc pfnProgress,
5151
void *pProgressData);
5252
};
@@ -427,7 +427,7 @@ GDALDataset *CALSDataset::Open(GDALOpenInfo *poOpenInfo)
427427

428428
GDALDataset *CALSDataset::CreateCopy(const char *pszFilename,
429429
GDALDataset *poSrcDS, int bStrict,
430-
char ** /* papszOptionsUnused */,
430+
CSLConstList /* papszOptionsUnused */,
431431
GDALProgressFunc pfnProgress,
432432
void *pProgressData)
433433
{

frmts/daas/daasdataset.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ class GDALDAASDataset final : public GDALDataset
149149
CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize,
150150
int /* nBufXSize */, int /* nBufYSize */,
151151
GDALDataType /* eBufType */, int /*nBands*/,
152-
int * /*panBands*/, char ** /* papszOptions */) override;
152+
int * /*panBands*/,
153+
CSLConstList /* papszOptions */) override;
153154
CPLErr FlushCache(bool bAtClosing) override;
154155
};
155156

@@ -183,7 +184,7 @@ class GDALDAASRasterBand final : public GDALRasterBand
183184
CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize,
184185
int /* nBufXSize */, int /* nBufYSize */,
185186
GDALDataType /* eBufType */,
186-
char ** /* papszOptions */) override;
187+
CSLConstList /* papszOptions */) override;
187188
double GetNoDataValue(int *pbHasNoData) override;
188189
GDALColorInterp GetColorInterpretation() override;
189190
GDALRasterBand *GetMaskBand() override;
@@ -396,7 +397,8 @@ static double DAASBackoffFactor(double base)
396397
/* DAAS_CPLHTTPFetch() */
397398
/************************************************************************/
398399

399-
static CPLHTTPResult *DAAS_CPLHTTPFetch(const char *pszURL, char **papszOptions)
400+
static CPLHTTPResult *DAAS_CPLHTTPFetch(const char *pszURL,
401+
CSLConstList papszOptions)
400402
{
401403
CPLHTTPResult *psResult;
402404
const int RETRY_COUNT = 4;
@@ -1597,7 +1599,7 @@ CPLErr GDALDAASDataset::AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize,
15971599
int nBufXSize, int nBufYSize,
15981600
GDALDataType /* eBufType */, int /*nBands*/,
15991601
int * /*panBands*/,
1600-
char ** /* papszOptions */)
1602+
CSLConstList /* papszOptions */)
16011603
{
16021604
if (nXSize == nBufXSize && nYSize == nBufYSize)
16031605
{
@@ -1752,7 +1754,7 @@ CPLErr GDALDAASRasterBand::IRasterIO(GDALRWFlag eRWFlag, int nXOff, int nYOff,
17521754
CPLErr GDALDAASRasterBand::AdviseRead(int nXOff, int nYOff, int nXSize,
17531755
int nYSize, int nBufXSize, int nBufYSize,
17541756
GDALDataType /* eBufType */,
1755-
char ** /* papszOptions */)
1757+
CSLConstList /* papszOptions */)
17561758
{
17571759
GDALDAASDataset *poGDS = cpl::down_cast<GDALDAASDataset *>(poDS);
17581760
if (nXSize == nBufXSize && nYSize == nBufYSize)

0 commit comments

Comments
 (0)