Closed dbaston closed 1 week ago
Yes we should support YES,TRUE,ON,1 . For CPL_DEBUG, we can't use CPLTestBool() for that, since CPL_DEBUG also accepts other strings to filter by component. For CPL_TIMESTAMP, we should just use CPLTestBool()
And we should likely enhance CPLTestBool() to warn if the string passed to it is not one of YES,TRUE,ON,1,NO,FALSE,OFF,0
And we should likely enhance CPLTestBool() to warn if the string passed to it is not one of YES,TRUE,ON,1,NO,FALSE,OFF,0
It wouldn't hurt for now, but unless I'm mistaken there would be no way for the error message to contain the context from which it was called?
Longer-term, something returning a std::optional<bool>
would let the caller issue a more informative message. (https://github.com/OSGeo/gdal/issues/9953)
Should or already does? At the moment,
CPL_DEBUG=ON
works, butYES
andTRUE
don't.Originally posted by @lnicola in https://github.com/OSGeo/gdal/issues/8440#issuecomment-2461386030
Nearby,
CPL_TIMESTAMP
interprets any value as "YES", including "NO".