MCPcopy Create free account
hub / github.com/OSGeo/gdal / CheckCanSetDatasetObject

Function CheckCanSetDatasetObject

gcore/gdalalgorithm.cpp:440–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440static bool CheckCanSetDatasetObject(const GDALAlgorithmArg *arg)
441{
442 if (arg->IsOutput() && arg->GetDatasetInputFlags() == GADV_NAME &&
443 arg->GetDatasetOutputFlags() == GADV_OBJECT)
444 {
445 CPLError(
446 CE_Failure, CPLE_AppDefined,
447 "Dataset object '%s' is created by algorithm and cannot be set "
448 "as an input.",
449 arg->GetName().c_str());
450 return false;
451 }
452 else if ((arg->GetDatasetInputFlags() & GADV_OBJECT) == 0)
453 {
454 CPLError(CE_Failure, CPLE_AppDefined,
455 "Dataset%s '%s' must be provided by name, not as object.",
456 arg->GetMaxCount() > 1 ? "s" : "", arg->GetName().c_str());
457 return false;
458 }
459
460 return true;
461}
462
463bool GDALAlgorithmArg::Set(GDALDataset *ds)
464{

Callers 4

SetMethod · 0.85
SetFromMethod · 0.85
ProcessDatasetArgMethod · 0.85
ValidateArgumentsMethod · 0.85

Calls 3

CPLErrorFunction · 0.85
c_strMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected