| 438 | } |
| 439 | |
| 440 | static 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 | |
| 463 | bool GDALAlgorithmArg::Set(GDALDataset *ds) |
| 464 | { |
no test coverage detected