13#ifndef GDAL_ALGORITHM_CPP_INCLUDED
14#define GDAL_ALGORITHM_CPP_INCLUDED
16#include "gdalalgorithm_c.h"
26#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) && \
27 (defined(DOXYGEN_SKIP) || __cplusplus >= 201703L || _MSC_VER >= 1920)
46constexpr const char *GAAC_COMMON =
"Common";
49constexpr const char *GAAC_BASE =
"Base";
52constexpr const char *GAAC_ADVANCED =
"Advanced";
55constexpr const char *GAAC_ESOTERIC =
"Esoteric";
59constexpr const char *GAAMDI_REQUIRED_CAPABILITIES =
"required_capabilities";
62constexpr const char *GAAMDI_VRT_COMPATIBLE =
"vrt_compatible";
65constexpr const char *GAAMDI_ALLOWED_FORMATS =
"allowed_formats";
68constexpr const char *GAAMDI_EXCLUDED_FORMATS =
"excluded_formats";
71constexpr const char *GAAMDI_EXTRA_FORMATS =
"extra_formats";
74constexpr const char *GDAL_ARG_NAME_INPUT =
"input";
77constexpr const char *GDAL_ARG_NAME_INPUT_CRS =
"input-crs";
80constexpr const char *GDAL_ARG_NAME_INPUT_FORMAT =
"input-format";
83constexpr const char *GDAL_ARG_NAME_INPUT_LAYER =
"input-layer";
86constexpr const char *GDAL_ARG_NAME_OPEN_OPTION =
"open-option";
89constexpr const char *GDAL_ARG_NAME_OUTPUT =
"output";
92constexpr const char *GDAL_ARG_NAME_OUTPUT_STRING =
"output-string";
95constexpr const char *GDAL_ARG_NAME_STDOUT =
"stdout";
98constexpr const char *GDAL_ARG_NAME_OUTPUT_CRS =
"output-crs";
101constexpr const char *GDAL_ARG_NAME_OUTPUT_FORMAT =
"output-format";
104constexpr const char *GDAL_ARG_NAME_OUTPUT_LAYER =
"output-layer";
107constexpr const char *GDAL_ARG_NAME_CREATION_OPTION =
"creation-option";
110constexpr const char *GDAL_ARG_NAME_LAYER_CREATION_OPTION =
111 "layer-creation-option";
114constexpr const char *GDAL_ARG_NAME_UPDATE =
"update";
117constexpr const char *GDAL_ARG_NAME_OVERWRITE =
"overwrite";
120constexpr const char *GDAL_ARG_NAME_OVERWRITE_LAYER =
"overwrite-layer";
123constexpr const char *GDAL_ARG_NAME_APPEND =
"append";
126constexpr const char *GDAL_ARG_NAME_READ_ONLY =
"read-only";
129constexpr const char *GDAL_ARG_NAME_NUM_THREADS =
"num-threads";
132constexpr const char *GDAL_ARG_NAME_NUM_THREADS_INT_HIDDEN =
133 "num-threads-int-hidden";
136constexpr const char *GDAL_ARG_NAME_QUIET =
"quiet";
141constexpr const char *GDAL_ALG_DCAP_RASTER_OR_MULTIDIM_RASTER =
142 "raster-or-multidim-raster";
147constexpr const char *GDAL_DATASET_PIPELINE_PLACEHOLDER_VALUE =
"_PIPE_";
154std::string CPL_DLL GDALAlgorithmArgDatasetTypeName(GDALArgDatasetType);
170 : m_name(name), m_nameSet(true)
232 m_name = other.m_name;
248 void Set(
const std::string &name);
252 void Set(std::unique_ptr<GDALDataset> poDS);
265 m_openedByAlgorithm =
true;
271 return m_openedByAlgorithm;
292 std::string m_name{};
295 bool m_nameSet =
false;
298 bool m_openedByAlgorithm =
false;
317 static constexpr int UNBOUNDED = std::numeric_limits<int>::max();
328 const std::string &description,
329 GDALAlgorithmArgType type);
334 m_aliases.push_back(alias);
341 m_shortNameAliases.push_back(shortNameAlias);
349 m_hiddenAliases.push_back(alias);
384 m_category = category;
392 m_hasDefaultValue =
true;
399 if constexpr (std::is_same_v<T, bool>)
401 m_defaultValue = value;
409 if constexpr (std::is_same_v<T, std::string>)
411 m_defaultValue = value;
419 if constexpr (std::is_same_v<T, int>)
421 m_defaultValue = value;
429 if constexpr (std::is_assignable_v<double &, T>)
431 m_defaultValue =
static_cast<double>(value);
437 case GAAT_STRING_LIST:
439 if constexpr (std::is_same_v<T, std::string>)
441 m_defaultValue = std::vector<std::string>{value};
444 else if constexpr (std::is_same_v<T,
445 std::vector<std::string>>)
447 m_defaultValue = value;
453 case GAAT_INTEGER_LIST:
455 if constexpr (std::is_same_v<T, int>)
457 m_defaultValue = std::vector<int>{value};
460 else if constexpr (std::is_same_v<T, std::vector<int>>)
462 m_defaultValue = value;
470 if constexpr (std::is_assignable_v<double &, T>)
473 std::vector<double>{
static_cast<double>(value)};
476 else if constexpr (std::is_same_v<T, std::vector<double>>)
478 m_defaultValue = value;
485 case GAAT_DATASET_LIST:
489 catch (
const std::bad_variant_access &)
495 "Argument %s: SetDefault(): unexpected type for value",
504 return SetDefault(std::string(value));
526 m_displayHintAboutRepetition = displayHint;
536 m_packedValuesAllowed = allowed;
546 m_repeatedArgAllowed = allowed;
556 m_duplicateValuesAllowed = allowed;
572 typename T,
typename... U,
573 typename std::enable_if<!std::is_same_v<T, std::vector<std::string> &>,
577 m_choices.push_back(std::forward<T>(first));
578 SetChoices(std::forward<U>(rest)...);
599 m_minValIsIncluded =
true;
611 m_minValIsIncluded =
false;
619 m_maxValIsIncluded =
true;
627 m_maxValIsIncluded =
false;
636 m_minCharCount = count;
645 m_maxCharCount = count;
660 template <
typename T,
typename... U>
663 m_hiddenChoices.push_back(std::forward<T>(first));
664 SetHiddenChoices(std::forward<U>(rest)...);
674 m_hiddenForCLI = hiddenForCLI;
683 m_hiddenForAPI = hiddenForAPI;
692 m_hiddenForCLI =
true;
693 m_hiddenForAPI =
true;
717 m_isOutput = isOutput;
726 m_mutualExclusionGroup = group;
738 m_mutualDependencyGroup = group;
745 return m_mutualDependencyGroup;
755 m_directDependencies.push_back(otherArgName);
763 const std::vector<std::string> &values)
765 m_metadata[name] = values;
775 m_readFromFileAtSyntaxAllowed =
true;
783 m_removeSQLComments =
true;
792 m_autoOpenDataset = autoOpen;
801 m_userProvided =
true;
826 return m_shortNameAliases;
832 return m_description;
871 return m_hiddenChoices;
877 return {m_minVal, m_minValIsIncluded};
883 return {m_maxVal, m_maxValIsIncluded};
891 return m_minCharCount;
899 return m_maxCharCount;
931 return m_displayHintAboutRepetition;
940 return m_packedValuesAllowed;
949 return m_repeatedArgAllowed;
958 return m_duplicateValuesAllowed;
970 return m_hasDefaultValue;
977 return m_hiddenForCLI && m_hiddenForAPI;
986 return m_hiddenForCLI;
994 CPL_WARN_DEPRECATED("Use IsHiddenForAPI() instead")
996 return m_hiddenForAPI;
1003 return m_hiddenForAPI;
1034 return m_mutualExclusionGroup;
1049 return m_directDependencies;
1058 return m_readFromFileAtSyntaxAllowed;
1065 return m_removeSQLComments;
1073 return m_autoOpenDataset;
1080 return m_userProvided;
1084 inline const std::map<std::string, std::vector<std::string>>
1091 inline const std::vector<std::string> *
1094 const auto iter = m_metadata.find(name);
1095 return iter == m_metadata.end() ? nullptr : &(iter->second);
1114 return std::get<T>(m_defaultValue);
1124 return m_datasetType;
1134 m_datasetType = type;
1150 return m_datasetInputFlags;
1165 return m_datasetOutputFlags;
1174 m_datasetInputFlags = flags;
1183 m_datasetOutputFlags = flags;
1192 m_availableInPipelineStep = available;
1201 return m_availableInPipelineStep;
1205 const std::string m_longName;
1206 const std::string m_shortName;
1207 const std::string m_description;
1208 const GDALAlgorithmArgType m_type;
1209 std::string m_category = GAAC_BASE;
1210 std::string m_metaVar{};
1211 std::string m_mutualExclusionGroup{};
1212 std::string m_mutualDependencyGroup{};
1215 bool m_required =
false;
1216 bool m_positional =
false;
1217 bool m_hasDefaultValue =
false;
1218 bool m_hiddenForCLI =
false;
1219 bool m_hiddenForAPI =
false;
1220 bool m_isInput =
true;
1221 bool m_isOutput =
false;
1222 bool m_packedValuesAllowed =
true;
1223 bool m_repeatedArgAllowed =
true;
1224 bool m_displayHintAboutRepetition =
true;
1225 bool m_readFromFileAtSyntaxAllowed =
false;
1226 bool m_removeSQLComments =
false;
1227 bool m_autoOpenDataset =
true;
1228 bool m_userProvided =
false;
1229 bool m_duplicateValuesAllowed =
true;
1230 bool m_availableInPipelineStep =
true;
1231 std::map<std::string, std::vector<std::string>> m_metadata{};
1232 std::vector<std::string> m_aliases{};
1233 std::vector<std::string> m_hiddenAliases{};
1234 std::vector<std::string> m_directDependencies{};
1235 std::vector<char> m_shortNameAliases{};
1236 std::vector<std::string> m_choices{};
1237 std::vector<std::string> m_hiddenChoices{};
1238 std::variant<bool, std::string, int, double, std::vector<std::string>,
1239 std::vector<int>, std::vector<double>>
1241 double m_minVal = std::numeric_limits<double>::quiet_NaN();
1242 double m_maxVal = std::numeric_limits<double>::quiet_NaN();
1243 bool m_minValIsIncluded =
false;
1244 bool m_maxValIsIncluded =
false;
1245 int m_minCharCount = 0;
1246 int m_maxCharCount = std::numeric_limits<int>::max();
1247 GDALArgDatasetType m_datasetType =
1253 int m_datasetInputFlags = GADV_NAME | GADV_OBJECT;
1258 int m_datasetOutputFlags = GADV_OBJECT;
1275 : m_decl(decl), m_value(pValue)
1277 if constexpr (!std::is_same_v<T, GDALArgDatasetValue> &&
1278 !std::is_same_v<T, std::vector<GDALArgDatasetValue>>)
1284 *std::get<T *>(m_value) = decl.
GetDefault<T>();
1286 catch (
const std::bad_variant_access &e)
1291 "*std::get<T *>(m_value) = decl.GetDefault<T>() "
1311 return m_decl.GetName();
1317 return m_decl.GetShortName();
1323 return m_decl.GetAliases();
1329 return m_decl.GetShortNameAliases();
1335 return m_decl.GetDescription();
1341 return m_decl.GetMetaVar();
1347 return m_decl.GetType();
1353 return m_decl.GetCategory();
1359 return m_decl.IsRequired();
1365 return m_decl.GetMinCount();
1371 return m_decl.GetMaxCount();
1377 return m_decl.GetDisplayHintAboutRepetition();
1383 return m_decl.GetPackedValuesAllowed();
1389 return m_decl.GetRepeatedArgAllowed();
1395 return m_decl.GetDuplicateValuesAllowed();
1401 return m_decl.IsPositional();
1407 return m_decl.GetChoices();
1413 return m_decl.GetHiddenChoices();
1419 inline std::vector<std::string>
1422 if (m_autoCompleteFunction)
1423 return m_autoCompleteFunction(currentValue);
1430 return m_decl.GetMinValue();
1436 return m_decl.GetMaxValue();
1442 return m_decl.GetMinCharCount();
1448 return m_decl.GetMaxCharCount();
1454 return m_explicitlySet;
1460 return m_decl.HasDefaultValue();
1466 return m_decl.IsHidden();
1472 return m_decl.IsHiddenForCLI();
1477 CPL_WARN_DEPRECATED("Use IsHiddenForAPI() instead")
1479 return m_decl.IsHiddenForAPI();
1485 return m_decl.IsHiddenForAPI();
1491 return m_decl.IsInput();
1497 return m_decl.IsOutput();
1503 return m_decl.IsReadFromFileAtSyntaxAllowed();
1509 return m_decl.IsRemoveSQLCommentsEnabled();
1515 return m_decl.GetMutualExclusionGroup();
1521 return m_decl.GetMutualDependencyGroup();
1527 return m_decl.GetDirectDependencies();
1531 inline const std::map<std::string, std::vector<std::string>>
1534 return m_decl.GetMetadata();
1538 inline const std::vector<std::string> *
1541 return m_decl.GetMetadataItem(name);
1547 return m_decl.GetDefault<T>();
1553 return m_decl.AutoOpenDataset();
1559 return m_decl.IsUserProvided();
1565 return m_decl.GetDatasetType();
1571 return m_decl.GetDatasetInputFlags();
1577 return m_decl.GetDatasetOutputFlags();
1583 return m_decl.IsAvailableInPipelineStep();
1602 template <
class T>
inline T &
Get()
1604 return *(std::get<T *>(m_value));
1623 template <
class T>
inline const T &
Get()
const
1625 return *(std::get<T *>(m_value));
1633 bool Set(
bool value);
1640 bool Set(
const std::string &value);
1649 return Set(std::string(value ? value :
""));
1675 bool Set(
int value);
1678 bool Set(
double value);
1693 bool Set(std::unique_ptr<GDALDataset> ds);
1700 bool SetDatasetName(
const std::string &name);
1715 bool Set(
const std::vector<std::string> &value);
1722 bool Set(
const std::vector<int> &value);
1729 bool Set(
const std::vector<double> &value);
1736 bool Set(std::vector<GDALArgDatasetValue> &&value);
1830 m_skipIfAlreadySet = skip;
1837 return m_skipIfAlreadySet;
1844 bool Serialize(std::string &serializedArg,
bool absolutePath =
false)
const;
1847 static std::string GetEscapedString(
const std::string &s);
1850 void NotifyValueSet()
1852 m_explicitlySet =
true;
1863 std::vector<std::string> *, std::vector<int> *,
1864 std::vector<double> *, std::vector<GDALArgDatasetValue> *>
1867 std::vector<std::function<void()>> m_actions{};
1869 std::vector<std::function<bool()>> m_validationActions{};
1871 std::function<std::vector<std::string>(
const std::string &)>
1872 m_autoCompleteFunction{};
1877 bool m_skipIfAlreadySet =
false;
1878 bool m_explicitlySet =
false;
1880 template <
class T>
bool SetInternal(
const T &value)
1882 m_explicitlySet =
true;
1883 *std::get<T *>(m_value) = value;
1884 return RunAllActions();
1887 bool ProcessString(std::string &value)
const;
1889 bool RunAllActions();
1891 bool RunValidationActions();
1892 std::string ValidateChoice(
const std::string &value)
const;
1893 bool ValidateIntRange(
int val)
const;
1894 bool ValidateRealRange(
double val)
const;
1907namespace test_gdal_algorithm
1909struct test_gdal_algorithm;
1919 friend struct test_gdal_algorithm::test_gdal_algorithm;
1973 if constexpr (!std::is_same_v<T, GDALArgDatasetValue> &&
1974 !std::is_same_v<T, std::vector<GDALArgDatasetValue>>)
1981 *std::get<bool *>(m_value) = m_decl.
GetDefault<
bool>();
1984 *std::get<std::string *>(m_value) =
1988 *std::get<int *>(m_value) = m_decl.
GetDefault<
int>();
1991 *std::get<double *>(m_value) =
1994 case GAAT_STRING_LIST:
1995 *std::get<std::vector<std::string> *>(m_value) =
1996 m_decl.
GetDefault<std::vector<std::string>>();
1998 case GAAT_INTEGER_LIST:
1999 *std::get<std::vector<int> *>(m_value) =
2002 case GAAT_REAL_LIST:
2003 *std::get<std::vector<double> *>(m_value) =
2007 case GAAT_DATASET_LIST:
2011 catch (
const std::bad_variant_access &)
2015 "Argument %s: SetDefault(): unexpected type for value",
2025 return SetDefault(std::string(value));
2073 typename T,
typename... U,
2074 typename std::enable_if<!std::is_same_v<T, std::vector<std::string> &>,
2078 m_decl.
SetChoices(std::forward<T>(first), std::forward<U>(rest)...);
2091 template <
typename T,
typename... U>
2095 std::forward<U>(rest)...);
2224 const std::vector<std::string> &values)
2257 m_actions.push_back(f);
2269 m_validationActions.push_back(f);
2277 std::function<std::vector<std::string>(
const std::string &)> f)
2279 m_autoCompleteFunction = std::move(f);
2290 SetIsCRSArg(
bool noneAllowed =
false,
2291 const std::vector<std::string> &specialValues =
2292 std::vector<std::string>());
2320 static constexpr const char *HIDDEN_ALIAS_SEPARATOR =
"==hide==";
2329 std::string m_name{};
2331 std::vector<std::string> m_aliases{};
2334 std::function m_creationFunc{};
2337 std::function<std::unique_ptr<GDALAlgorithm>(
void)> m_creationFunc{};
2346 info.
m_name = MyAlgorithm::NAME;
2347 info.
m_aliases = MyAlgorithm::GetAliasesStatic();
2349 {
return std::make_unique<MyAlgorithm>(); };
2350 return Register(info);
2355 bool Register(
const AlgInfo &info);
2362 std::vector<std::string> GetNames()
const;
2367 std::unique_ptr<GDALAlgorithm> Instantiate(
const std::string &name)
const;
2373 std::unique_ptr<GDALAlgorithm>
2374 Instantiate(
const std::vector<std::string> &path)
const;
2380 template <
typename... V>
2381 inline std::unique_ptr<GDALAlgorithm>
Instantiate(
const std::string &first,
2384 std::vector<std::string> path;
2385 return InstantiateInternal(path, first, std::forward<V>(rest)...);
2391 auto iter = m_mapNameToInfo.find(name);
2392 return iter != m_mapNameToInfo.end() ? &(iter->second) :
nullptr;
2398 return m_mapNameToInfo.empty();
2403 virtual std::unique_ptr<GDALAlgorithm>
2404 InstantiateTopLevel(
const std::string &name)
const;
2407 std::map<std::string, AlgInfo> m_mapNameToInfo{};
2408 std::map<std::string, AlgInfo> m_mapAliasToInfo{};
2409 std::map<std::string, AlgInfo> m_mapHiddenAliasToInfo{};
2411 std::unique_ptr<GDALAlgorithm>
2412 InstantiateInternal(std::vector<std::string> &path);
2414 template <
typename... V>
2415 std::unique_ptr<GDALAlgorithm>
2416 InstantiateInternal(std::vector<std::string> &path,
2417 const std::string &first, V &&...rest)
2419 path.push_back(first);
2420 return InstantiateInternal(path, std::forward<V>(rest)...);
2446 friend struct test_gdal_algorithm::test_gdal_algorithm;
2460 return m_description;
2466 return m_longDescription;
2480 return m_helpFullURL;
2490 bool HasSubAlgorithms()
const;
2497 std::vector<std::string> GetSubAlgorithmNames()
const;
2500 std::unique_ptr<GDALAlgorithm>
2501 InstantiateSubAlgorithm(
const std::string &name,
2502 bool suggestionAllowed =
true)
const;
2505 const std::vector<std::unique_ptr<GDALAlgorithmArg>> &
GetArgs()
const
2511 std::vector<std::unique_ptr<GDALAlgorithmArg>> &
GetArgs()
2517 std::string GetSuggestionForArgumentName(
const std::string &osName)
const;
2521 bool suggestionAllowed =
false)
2523 return GetArg(osName, suggestionAllowed,
false);
2529 auto alg = GetArg(osName,
false);
2533 "Argument '%s' does not exist", osName.c_str());
2541 bool suggestionAllowed =
false)
const
2544 osName, suggestionAllowed,
true);
2550 const auto alg = GetArg(osName,
false);
2554 "Argument '%s' does not exist", osName.c_str());
2562 std::vector<std::string>
2563 GetArgDependencies(
const std::string &osName)
const;
2581 m_parseForAutoCompletion =
true;
2590 m_referencePath = referencePath;
2596 return m_referencePath;
2602 return m_supportsStreamedOutput;
2614 m_executionForStreamOutput =
true;
2621 ParseCommandLineArguments(
const std::vector<std::string> &args);
2632 virtual bool ValidateArguments();
2639 bool Run(GDALProgressFunc pfnProgress =
nullptr,
2640 void *pProgressData =
nullptr);
2645 virtual bool Finalize();
2658 : isPipelineStep(false), maxOptLen(0), isPipelineMain(false)
2667 GetUsageForCLI(
bool shortUsage,
2668 const UsageOptions &usageOptions = UsageOptions())
const;
2674 virtual std::string GetUsageAsJSON()
const;
2683 if (m_selectedSubAlg)
2691 return m_helpRequested;
2697 return m_JSONUsageRequested;
2703 if (m_selectedSubAlg)
2704 return m_selectedSubAlg->IsProgressBarRequested();
2705 return m_progressBarRequested;
2718 static std::vector<std::string> GetAliasesStatic()
2731 target->m_calledFromCommandLine = m_calledFromCommandLine;
2734 if (m_specialActionRequested)
2736 target->m_specialActionRequested = m_specialActionRequested;
2737 target->m_helpRequested = m_helpRequested;
2738 target->m_helpDocRequested = m_helpDocRequested;
2739 target->m_JSONUsageRequested = m_JSONUsageRequested;
2746 virtual std::vector<std::string>
2747 GetAutoComplete(std::vector<std::string> &args,
bool lastWordIsComplete,
2748 bool showAllOptions);
2753 m_calledFromCommandLine =
true;
2759 return m_calledFromCommandLine;
2763 virtual bool HasOutputString()
const;
2768 static bool SaveGDALG(
const std::string &filename, std::string &outString,
2769 const std::string &commandLine);
2778 friend class GDALRasterReprojectUtils;
2787 std::vector<std::
string> m_callPath{};
2790 std::string m_longDescription{};
2793 bool m_progressBarRequested =
true;
2796 bool m_quiet =
false;
2799 bool m_skipValidationInParseCommandLine =
false;
2804 bool m_inputDatasetCanBeOmitted =
false;
2808 std::vector<std::string> m_aliases{};
2811 bool m_supportsStreamedOutput =
false;
2814 bool m_executionForStreamOutput =
false;
2817 bool m_hidden =
false;
2820 bool m_alreadyRun =
false;
2823 std::map<std::string, GDALDataset *> m_oMapDatasetNameToDataset{};
2826 GDALAlgorithm(
const std::string &name,
const std::string &description,
2827 const std::string &helpURL);
2836 return m_subAlgRegistry.Register<MyAlgorithm>();
2843 return m_subAlgRegistry.Register(info);
2849 m_arbitraryLongNameArgsAllowed =
true;
2855 const std::string &helpMessage,
2861 const std::string &helpMessage,
2862 std::string *pValue);
2867 const std::string &helpMessage,
2873 const std::string &helpMessage,
2879 GDALArgDatasetType type);
2883 AddArg(
const std::string &longName,
char chShortName,
2891 const std::string &helpMessage,
2892 std::vector<std::string> *pValue);
2897 const std::string &helpMessage,
2898 std::vector<int> *pValue);
2903 const std::string &helpMessage,
2904 std::vector<double> *pValue);
2908 AddArg(
const std::string &longName,
char chShortName,
2909 const std::string &helpMessage,
2910 std::vector<GDALArgDatasetValue> *pValue,
2919 bool positionalAndRequired =
true,
const char *helpMessage =
nullptr);
2923 std::vector<GDALArgDatasetValue> *pValue,
2926 bool positionalAndRequired =
true,
const char *helpMessage =
nullptr);
2930 AddOpenOptionsArg(std::vector<std::string> *pValue,
2931 const char *helpMessage =
nullptr);
2935 AddOutputOpenOptionsArg(std::vector<std::string> *pValue,
2936 const char *helpMessage =
nullptr);
2940 AddInputFormatsArg(std::vector<std::string> *pValue,
2941 const char *helpMessage =
nullptr);
2948 bool positionalAndRequired =
true,
const char *helpMessage =
nullptr);
2952 AddOverwriteArg(
bool *pValue,
const char *helpMessage =
nullptr);
2956 AddOverwriteLayerArg(
bool *pValue,
const char *helpMessage =
nullptr);
2960 AddUpdateArg(
bool *pValue,
const char *helpMessage =
nullptr);
2964 AddAppendLayerArg(
bool *pValue,
const char *helpMessage =
nullptr);
2968 AddOutputStringArg(std::string *pValue,
const char *helpMessage =
nullptr);
2972 AddStdoutArg(
bool *pValue,
const char *helpMessage =
nullptr);
2976 AddOutputFormatArg(std::string *pValue,
bool bStreamAllowed =
false,
2977 bool bGDALGAllowed =
false,
2978 const char *helpMessage =
nullptr);
2982 AddOutputDataTypeArg(std::string *pValue,
2983 const char *helpMessage =
nullptr);
2987 AddNodataArg(std::string *pValue,
bool noneAllowed,
2988 const std::string &optionName =
"nodata",
2989 const char *helpMessage =
nullptr);
2993 AddCreationOptionsArg(std::vector<std::string> *pValue,
2994 const char *helpMessage =
nullptr);
2998 AddLayerCreationOptionsArg(std::vector<std::string> *pValue,
2999 const char *helpMessage =
nullptr);
3003 AddLayerNameArg(std::string *pValue,
const char *helpMessage =
nullptr);
3007 AddOutputLayerNameArg(std::string *pValue,
3008 const char *helpMessage =
nullptr);
3012 AddLayerNameArg(std::vector<std::string> *pValue,
3013 const char *helpMessage =
nullptr);
3017 AddArrayNameArg(std::string *pValue,
const char *helpMessage =
nullptr);
3021 AddArrayNameArg(std::vector<std::string> *pValue,
3022 const char *helpMessage =
nullptr);
3029 AddMemorySizeArg(
size_t *pValue, std::string *pStrValue,
3030 const std::string &optionName,
const char *helpMessage);
3034 AddGeometryTypeArg(std::string *pValue,
const char *helpMessage =
nullptr);
3037 static void SetAutoCompleteFunctionForLayerName(
3041 static void SetAutoCompleteFunctionForFieldName(
3044 bool geometryFields, std::vector<GDALArgDatasetValue> &datasetArg);
3048 AddFieldNameArg(std::string *pValue,
const char *helpMessage =
nullptr);
3057 static bool ParseFieldDefinition(
const std::string &osStrDef,
3059 std::string *posError);
3069 AddFieldDefinitionArg(std::vector<std::string> *pValues,
3070 std::vector<OGRFieldDefn> *pFieldDefns,
3071 const char *helpMessage =
nullptr);
3076 std::string *pStrValue,
const std::string &argName = std::string(),
3077 const char *helpMessage =
nullptr);
3081 AddBandArg(
int *pValue,
const char *helpMessage =
nullptr);
3085 AddBandArg(std::vector<int> *pValue,
const char *helpMessage =
nullptr);
3089 AddBBOXArg(std::vector<double> *pValue,
const char *helpMessage =
nullptr);
3093 AddActiveLayerArg(std::string *pValue,
const char *helpMessage =
nullptr);
3100 AddNumThreadsArg(
int *pValue, std::string *pStrValue,
3101 const char *helpMessage =
nullptr);
3105 AddAbsolutePathArg(
bool *pValue,
const char *helpMessage =
nullptr);
3109 AddPixelFunctionNameArg(std::string *pValue,
3110 const char *helpMessage =
nullptr);
3114 AddPixelFunctionArgsArg(std::vector<std::string> *pValue,
3115 const char *helpMessage =
nullptr);
3118 void AddProgressArg();
3128 m_validationActions.push_back(f);
3132 static bool AddOptionsSuggestions(
const char *pszXML,
int datasetType,
3133 const std::string ¤tValue,
3134 std::vector<std::string> &oRet);
3140 bool RunPreStepPipelineValidations()
const;
3143 bool IsGDALGOutput()
const;
3157 virtual ProcessGDALGOutputRet ProcessGDALGOutput();
3162 virtual bool CheckSafeForStreamOutput();
3166 bool bGDALGAllowed)
const;
3169 static std::vector<std::string>
3170 FormatAutoCompleteFunction(
const GDALAlgorithmArg &arg,
bool bStreamAllowed,
3171 bool bGDALGAllowed);
3175 const std::string &alias);
3178 char shortNameAlias);
3182 std::vector<std::string>
3183 OpenOptionCompleteFunction(
const std::string ¤tValue)
const;
3188 static bool IsKnownOutputRelatedBooleanArgName(std::string_view osName);
3193 m_displayInJSONUsage = b;
3204 std::pair<std::vector<std::pair<GDALAlgorithmArg *, std::string>>,
size_t>
3205 GetArgNamesForCLI()
const;
3208 static bool GetFieldIndices(
const std::vector<std::string> &osFieldNames,
3209 OGRLayerH hLayer, std::vector<int> &anIndices);
3212 std::string GetUsageForCLIEnd()
const;
3216 const std::string m_name{};
3217 const std::string m_description{};
3218 const std::string m_helpURL{};
3219 const std::string m_helpFullURL{};
3220 bool m_parsedSubStringAlreadyCalled =
false;
3221 bool m_displayInJSONUsage =
true;
3222 bool m_specialActionRequested =
false;
3223 bool m_helpRequested =
false;
3224 bool m_calledFromCommandLine =
false;
3227 bool m_helpDocRequested =
false;
3229 bool m_JSONUsageRequested =
false;
3230 bool m_parseForAutoCompletion =
false;
3231 std::string m_referencePath{};
3232 std::vector<std::string> m_dummyConfigOptions{};
3233 std::vector<std::unique_ptr<GDALAlgorithmArg>> m_args{};
3234 std::map<std::string, GDALAlgorithmArg *> m_mapLongNameToArg{};
3235 std::map<std::string, GDALAlgorithmArg *> m_mapShortNameToArg{};
3236 std::vector<GDALAlgorithmArg *> m_positionalArgs{};
3238 std::unique_ptr<GDALAlgorithm> m_selectedSubAlgHolder{};
3239 std::function<std::vector<std::string>(
const std::vector<std::string> &)>
3240 m_autoCompleteFunction{};
3241 std::vector<std::function<bool()>> m_validationActions{};
3243 std::string m_dummyVal{};
3250 bool m_arbitraryLongNameArgsAllowed =
false;
3252 std::vector<std::unique_ptr<std::string>>
3253 m_arbitraryLongNameArgsValuesStr{};
3254 std::vector<std::unique_ptr<bool>> m_arbitraryLongNameArgsValuesBool{};
3256 friend GDALAlgorithmArgH GDALAlgorithmGetArg(GDALAlgorithmH hAlg,
3257 const char *pszArgName);
3258 friend GDALAlgorithmArgH
3259 GDALAlgorithmGetArgNonConst(GDALAlgorithmH hAlg,
const char *pszArgName);
3260 GDALAlgorithmArg *GetArg(
const std::string &osName,
bool suggestionAllowed,
3264 AddArg(std::unique_ptr<GDALInConstructionAlgorithmArg> arg);
3267 const std::string &value,
3270 std::variant<std::vector<std::string>, std::vector<int>,
3271 std::vector<double>, std::vector<GDALArgDatasetValue>>>
3272 &inConstructionValues);
3274 bool ValidateBandArg()
const;
3276 virtual bool RunImpl(GDALProgressFunc pfnProgress,
void *pProgressData) = 0;
3281 void ExtractLastOptionAndValue(std::vector<std::string> &args,
3282 std::string &option,
3283 std::string &value)
const;
3285 std::vector<std::string> AutoCompleteArrayName()
const;
3292struct GDALAlgorithmHS
3295 std::unique_ptr<GDALAlgorithm> uniquePtr{};
3297 GDALAlgorithmHS(
const GDALAlgorithmHS &) =
delete;
3298 GDALAlgorithmHS &operator=(
const GDALAlgorithmHS &) =
delete;
3303 GDALAlgorithmHS() =
default;
3305 explicit GDALAlgorithmHS(std::unique_ptr<GDALAlgorithm> alg)
3306 : uniquePtr(std::move(alg)), ptr(uniquePtr.get())
3310 static std::unique_ptr<GDALAlgorithmHS> FromRef(
GDALAlgorithm &alg)
3312 auto ret = std::make_unique<GDALAlgorithmHS>();
3325 explicit GDALContainerAlgorithm(
3326 const std::string &name,
const std::string &description = std::string(),
3327 const std::string &helpURL = std::string())
3333 bool RunImpl(GDALProgressFunc,
void *)
override;
3348 static constexpr const char *ROOT_ALG_NAME =
"gdal";
3362 void DeclareAlgorithm(
const std::vector<std::string> &path,
3367 std::vector<std::string>
3368 GetDeclaredSubAlgorithmNames(
const std::vector<std::string> &path)
const;
3371 bool HasDeclaredSubAlgorithm(
const std::vector<std::string> &path)
const;
3374 std::unique_ptr<GDALAlgorithm>
3375 InstantiateDeclaredSubAlgorithm(
const std::vector<std::string> &path)
const;
3378 std::unique_ptr<GDALAlgorithm>
3379 InstantiateTopLevel(
const std::string &name)
const override;
3385 std::map<std::string, Node> children{};
3393 const Node *GetNodeFromPath(
const std::vector<std::string> &path)
const;
Argument declaration.
Definition gdalalgorithm_cpp.h:313
const std::string & GetCategory() const
Return the argument category: GAAC_COMMON, GAAC_BASE, GAAC_ADVANCED, GAAC_ESOTERIC or a custom catego...
Definition gdalalgorithm_cpp.h:847
std::pair< double, bool > GetMaxValue() const
Return the maximum value and whether it is included.
Definition gdalalgorithm_cpp.h:881
GDALAlgorithmArgDecl & AddShortNameAlias(char shortNameAlias)
Declare a shortname alias.
Definition gdalalgorithm_cpp.h:339
bool GetPackedValuesAllowed() const
Return whether, for list type of arguments, several values, space separated, may be specified.
Definition gdalalgorithm_cpp.h:938
GDALAlgorithmArgDecl & SetReadFromFileAtSyntaxAllowed()
Set that this (string) argument accepts the @filename syntax to mean that the content of the specifie...
Definition gdalalgorithm_cpp.h:773
int GetDatasetOutputFlags() const
Indicates which components among name and dataset are modified, when this argument serves as an outpu...
Definition gdalalgorithm_cpp.h:1163
int GetMaxCount() const
Return the maximum number of values for the argument.
Definition gdalalgorithm_cpp.h:921
GDALAlgorithmArgDecl & SetDuplicateValuesAllowed(bool allowed)
Declares whether, for list type of arguments, there might be duplicate values in the list.
Definition gdalalgorithm_cpp.h:554
bool GetDuplicateValuesAllowed() const
Return whether, for list type of arguments, duplicated values in the list are allowed.
Definition gdalalgorithm_cpp.h:956
bool IsOutput() const
Return whether (at least part of) the value of the argument is set during the execution of the algori...
Definition gdalalgorithm_cpp.h:1023
GDALAlgorithmArgDecl & SetMinCount(int count)
Declare the minimum number of values for the argument.
Definition gdalalgorithm.cpp:195
GDALAlgorithmArgDecl & SetPackedValuesAllowed(bool allowed)
Declares whether, for list type of arguments, several values, comma separated, may be specified.
Definition gdalalgorithm_cpp.h:534
bool IsOnlyForCLI() const
Return whether the argument is only for CLI usage.
Definition gdalalgorithm_cpp.h:993
GDALAlgorithmArgDecl & SetMaxCount(int count)
Declare the maximum number of values for the argument.
Definition gdalalgorithm.cpp:214
void SetAvailableInPipelineStep(bool available)
Set whether the argument is available in a pipeline step.
Definition gdalalgorithm_cpp.h:1190
bool HasDefaultValue() const
Return if the argument has a declared default value.
Definition gdalalgorithm_cpp.h:968
const std::string & GetShortName() const
Return the short name, or empty string if there is none.
Definition gdalalgorithm_cpp.h:812
GDALAlgorithmArgDecl & SetMaxCharCount(int count)
Sets the maximum number of characters (for arguments of type GAAT_STRING and GAAT_STRING_LIST)
Definition gdalalgorithm_cpp.h:643
void SetDatasetOutputFlags(int flags)
Set which components among name and dataset are modified when this argument serves as an output.
Definition gdalalgorithm_cpp.h:1181
GDALAlgorithmArgDecl & SetHiddenChoices(T &&first, U &&...rest)
Declares the, hidden, allowed values (as strings) for the argument.
Definition gdalalgorithm_cpp.h:661
GDALAlgorithmArgDecl & SetDefault(const char *value)
Declare a default value for the argument.
Definition gdalalgorithm_cpp.h:502
GDALAlgorithmArgType GetType() const
Return the type.
Definition gdalalgorithm_cpp.h:853
const std::vector< std::string > & GetHiddenChoices() const
Return the allowed hidden values (as strings) for the argument.
Definition gdalalgorithm_cpp.h:869
bool IsHidden() const
Return whether the argument is hidden.
Definition gdalalgorithm_cpp.h:975
GDALAlgorithmArgDecl & SetMutualDependencyGroup(const std::string &group)
Set the name of the mutual dependency group to which this argument belongs to.
Definition gdalalgorithm_cpp.h:736
bool IsInput() const
Indicate whether the value of the argument is read-only during the execution of the algorithm.
Definition gdalalgorithm_cpp.h:1009
GDALAlgorithmArgDecl & SetMaxValueIncluded(double max)
Set the maximum (included) value allowed.
Definition gdalalgorithm_cpp.h:616
bool IsHiddenForAPI() const
Return whether the argument is hidden for API usage For example "--help".
Definition gdalalgorithm_cpp.h:1001
GDALAlgorithmArgDecl & SetHiddenForAPI(bool hiddenForAPI=true)
Declare that the argument is hidden in the context of an API use.
Definition gdalalgorithm_cpp.h:681
const std::string & GetMetaVar() const
Return the "meta-var" hint.
Definition gdalalgorithm_cpp.h:839
bool GetDisplayHintAboutRepetition() const
Returns whether in --help message one should display hints about the minimum/maximum number of values...
Definition gdalalgorithm_cpp.h:929
const std::vector< std::string > & GetAliases() const
Return the aliases (potentially none)
Definition gdalalgorithm_cpp.h:818
bool IsPositional() const
Return if the argument is a positional one.
Definition gdalalgorithm_cpp.h:962
GDALAlgorithmArgDecl & SetMaxValueExcluded(double max)
Set the maximum (excluded) value allowed.
Definition gdalalgorithm_cpp.h:624
void SetDatasetType(GDALArgDatasetType type)
Set which type of dataset is allowed / generated.
Definition gdalalgorithm_cpp.h:1132
bool IsRequired() const
Return whether the argument is required.
Definition gdalalgorithm_cpp.h:904
bool IsRemoveSQLCommentsEnabled() const
Returns whether SQL comments must be removed from a (string) argument.
Definition gdalalgorithm_cpp.h:1063
GDALAlgorithmArgDecl & SetMutualExclusionGroup(const std::string &group)
Set the name of the mutual exclusion group to which this argument belongs to.
Definition gdalalgorithm_cpp.h:724
int GetMinCount() const
Return the minimum number of values for the argument.
Definition gdalalgorithm_cpp.h:912
GDALAlgorithmArgDecl & SetCategory(const std::string &category)
Declare the argument category: GAAC_COMMON, GAAC_BASE, GAAC_ADVANCED, GAAC_ESOTERIC or a custom categ...
Definition gdalalgorithm_cpp.h:382
const std::vector< std::string > & GetDirectDependencies() const
Return the list of names of arguments that this argument directly depends on.
Definition gdalalgorithm_cpp.h:1047
GDALAlgorithmArgDecl & SetChoices(T &&first, U &&...rest)
Declares the allowed values (as strings) for the argument.
Definition gdalalgorithm_cpp.h:575
const std::vector< std::string > * GetMetadataItem(const std::string &name) const
Get user-defined metadata by item name.
Definition gdalalgorithm_cpp.h:1092
bool GetRepeatedArgAllowed() const
Return whether, for list type of arguments, the argument may be repeated.
Definition gdalalgorithm_cpp.h:947
bool IsAvailableInPipelineStep() const
Return whether the argument is available in a pipeline step.
Definition gdalalgorithm_cpp.h:1199
GDALAlgorithmArgDecl & SetIsInput(bool isInput=true)
Indicate whether the value of the argument is read-only during the execution of the algorithm.
Definition gdalalgorithm_cpp.h:700
void SetDatasetInputFlags(int flags)
Set which components among name and dataset are accepted as input, when this argument serves as an in...
Definition gdalalgorithm_cpp.h:1172
GDALAlgorithmArgDecl & SetRepeatedArgAllowed(bool allowed)
Declares whether, for list type of arguments, the argument may be repeated.
Definition gdalalgorithm_cpp.h:544
int GetMinCharCount() const
Return the minimum number of characters (for arguments of type GAAT_STRING and GAAT_STRING_LIST)
Definition gdalalgorithm_cpp.h:889
const std::vector< char > & GetShortNameAliases() const
Return the shortname aliases (potentially none)
Definition gdalalgorithm_cpp.h:824
const std::string & GetMutualExclusionGroup() const
Return the name of the mutual exclusion group to which this argument belongs to, or empty string if i...
Definition gdalalgorithm_cpp.h:1032
GDALAlgorithmArgDecl & SetMinCharCount(int count)
Sets the minimum number of characters (for arguments of type GAAT_STRING and GAAT_STRING_LIST)
Definition gdalalgorithm_cpp.h:634
bool IsReadFromFileAtSyntaxAllowed() const
Return if this (string) argument accepts the @filename syntax to mean that the content of the specifi...
Definition gdalalgorithm_cpp.h:1056
GDALAlgorithmArgDecl & AddAlias(const std::string &alias)
Declare an alias.
Definition gdalalgorithm_cpp.h:332
bool IsHiddenForCLI() const
Return whether the argument must not be mentioned in CLI usage.
Definition gdalalgorithm_cpp.h:984
GDALAlgorithmArgDecl & SetPositional()
Declare that the argument is positional.
Definition gdalalgorithm_cpp.h:355
GDALArgDatasetType GetDatasetType() const
Get which type of dataset is allowed / generated.
Definition gdalalgorithm_cpp.h:1122
GDALAlgorithmArgDecl & SetRequired()
Declare that the argument is required.
Definition gdalalgorithm_cpp.h:363
GDALAlgorithmArgDecl & SetUserProvided()
Declares that this argument has been created on-the-fly from user-provided argument.
Definition gdalalgorithm_cpp.h:799
const std::vector< std::string > & GetChoices() const
Return the allowed values (as strings) for the argument.
Definition gdalalgorithm_cpp.h:861
const std::string & GetMutualDependencyGroup() const
Returns the mutual dependency group name, or empty string if it doesn't belong to any group.
Definition gdalalgorithm_cpp.h:743
bool AutoOpenDataset() const
Returns whether the dataset should be opened automatically by GDALAlgorithm.
Definition gdalalgorithm_cpp.h:1071
GDALAlgorithmArgDecl & SetMetaVar(const std::string &metaVar)
Declare the "meta-var" hint.
Definition gdalalgorithm_cpp.h:373
bool IsUserProvided() const
Returns whether the argument has been user-provided.
Definition gdalalgorithm_cpp.h:1078
std::pair< double, bool > GetMinValue() const
Return the minimum value and whether it is included.
Definition gdalalgorithm_cpp.h:875
GDALAlgorithmArgDecl & AddMetadataItem(const std::string &name, const std::vector< std::string > &values)
Set user-defined metadata item.
Definition gdalalgorithm_cpp.h:762
int GetDatasetInputFlags() const
Indicates which components among name and dataset are accepted as input, when this argument serves as...
Definition gdalalgorithm_cpp.h:1148
const T & GetDefault() const
Return the default value of the argument.
Definition gdalalgorithm_cpp.h:1112
const std::string & GetDescription() const
Return the description.
Definition gdalalgorithm_cpp.h:830
GDALAlgorithmArgDecl & AddHiddenAlias(const std::string &alias)
Declare an hidden alias (i.e.
Definition gdalalgorithm_cpp.h:347
GDALAlgorithmArgDecl & SetMinValueIncluded(double min)
Set the minimum (included) value allowed.
Definition gdalalgorithm_cpp.h:596
GDALAlgorithmArgDecl & SetDefault(const T &value)
Declare a default value for the argument.
Definition gdalalgorithm_cpp.h:390
GDALAlgorithmArgDecl & SetChoices(const std::vector< std::string > &choices)
Declares the allowed values (as strings) for the argument.
Definition gdalalgorithm_cpp.h:585
GDALAlgorithmArgDecl & SetHiddenForCLI(bool hiddenForCLI=true)
Declare that the argument must not be mentioned in CLI usage.
Definition gdalalgorithm_cpp.h:672
GDALAlgorithmArgDecl & SetIsOutput(bool isOutput=true)
Indicate whether (at least part of) the value of the argument is set during the execution of the algo...
Definition gdalalgorithm_cpp.h:715
GDALAlgorithmArgDecl & SetAutoOpenDataset(bool autoOpen)
Sets whether the dataset should be opened automatically by GDALAlgorithm.
Definition gdalalgorithm_cpp.h:790
GDALAlgorithmArgDecl & SetDisplayHintAboutRepetition(bool displayHint)
Declare whether in --help message one should display hints about the minimum/maximum number of values...
Definition gdalalgorithm_cpp.h:524
GDALAlgorithmArgDecl & SetHidden()
Declare that the argument is hidden.
Definition gdalalgorithm_cpp.h:690
const std::string & GetName() const
Return the (long) name.
Definition gdalalgorithm_cpp.h:806
int GetMaxCharCount() const
Return the maximum number of characters (for arguments of type GAAT_STRING and GAAT_STRING_LIST)
Definition gdalalgorithm_cpp.h:897
const std::map< std::string, std::vector< std::string > > GetMetadata() const
Get user-defined metadata.
Definition gdalalgorithm_cpp.h:1085
GDALAlgorithmArgDecl & AddDirectDependency(const std::string &otherArgName)
Adds a direct dependency on another argument, meaning that if this argument is specified,...
Definition gdalalgorithm_cpp.h:753
GDALAlgorithmArgDecl & SetMinValueExcluded(double min)
Set the minimum (excluded) value allowed.
Definition gdalalgorithm_cpp.h:608
GDALAlgorithmArgDecl & SetRemoveSQLCommentsEnabled()
Sets that SQL comments must be removed from a (string) argument.
Definition gdalalgorithm_cpp.h:781
Argument of an algorithm.
Definition gdalalgorithm_cpp.h:1270
bool IsRemoveSQLCommentsEnabled() const
Alias for GDALAlgorithmArgDecl::IsRemoveSQLCommentsEnabled()
Definition gdalalgorithm_cpp.h:1507
T & Get()
Return the value of the argument, which is by decreasing order of priority:
Definition gdalalgorithm_cpp.h:1602
const std::string & GetMutualDependencyGroup() const
Alias for GDALAlgorithmArgDecl::GetMutualDependencyGroup()
Definition gdalalgorithm_cpp.h:1519
const std::vector< std::string > & GetAliases() const
Alias for GDALAlgorithmArgDecl::GetAliases()
Definition gdalalgorithm_cpp.h:1321
bool IsExplicitlySet() const
Return whether the argument value has been explicitly set with Set()
Definition gdalalgorithm_cpp.h:1452
int GetMinCount() const
Alias for GDALAlgorithmArgDecl::GetMinCount()
Definition gdalalgorithm_cpp.h:1363
GDALAlgorithmArg & operator=(const std::string &value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1760
const std::string & GetCategory() const
Alias for GDALAlgorithmArgDecl::GetCategory()
Definition gdalalgorithm_cpp.h:1351
bool IsInput() const
Alias for GDALAlgorithmArgDecl::IsInput()
Definition gdalalgorithm_cpp.h:1489
int GetMinCharCount() const
Alias for GDALAlgorithmArgDecl::GetMinCharCount()
Definition gdalalgorithm_cpp.h:1440
const T & Get() const
Return the value of the argument, which is by decreasing order of priority:
Definition gdalalgorithm_cpp.h:1623
bool IsRequired() const
Alias for GDALAlgorithmArgDecl::IsRequired()
Definition gdalalgorithm_cpp.h:1357
GDALAlgorithmArg & operator=(int value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1746
const std::string & GetName() const
Alias for GDALAlgorithmArgDecl::GetName()
Definition gdalalgorithm_cpp.h:1309
int GetDatasetInputFlags() const
Alias for GDALAlgorithmArgDecl::GetDatasetInputFlags()
Definition gdalalgorithm_cpp.h:1569
int GetMaxCount() const
Alias for GDALAlgorithmArgDecl::GetMaxCount()
Definition gdalalgorithm_cpp.h:1369
bool IsReadFromFileAtSyntaxAllowed() const
Alias for GDALAlgorithmArgDecl::IsReadFromFileAtSyntaxAllowed()
Definition gdalalgorithm_cpp.h:1501
const std::string & GetMetaVar() const
Alias for GDALAlgorithmArgDecl::GetMetaVar()
Definition gdalalgorithm_cpp.h:1339
int GetDatasetOutputFlags() const
Alias for GDALAlgorithmArgDecl::GetDatasetOutputFlags()
Definition gdalalgorithm_cpp.h:1575
GDALAlgorithmArg & operator=(const std::vector< int > &value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1788
const std::map< std::string, std::vector< std::string > > GetMetadata() const
Alias for GDALAlgorithmArgDecl::GetMetadata()
Definition gdalalgorithm_cpp.h:1532
const std::vector< std::string > & GetHiddenChoices() const
Alias for GDALAlgorithmArgDecl::GetHiddenChoices()
Definition gdalalgorithm_cpp.h:1411
const std::string & GetShortName() const
Alias for GDALAlgorithmArgDecl::GetShortName()
Definition gdalalgorithm_cpp.h:1315
GDALAlgorithmArg & operator=(const OGRSpatialReference &value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1781
const std::string & GetDescription() const
Alias for GDALAlgorithmArgDecl::GetDescription()
Definition gdalalgorithm_cpp.h:1333
GDALAlgorithmArg & operator=(const char *value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1767
const std::vector< std::string > & GetDirectDependencies() const
Alias for GDALAlgorithmArgDecl::GetDirectDependencies()
Definition gdalalgorithm_cpp.h:1525
const std::vector< std::string > * GetMetadataItem(const std::string &name) const
Alias for GDALAlgorithmArgDecl::GetMetadataItem()
Definition gdalalgorithm_cpp.h:1539
const std::vector< char > & GetShortNameAliases() const
Alias for GDALAlgorithmArgDecl::GetShortNameAliases()
Definition gdalalgorithm_cpp.h:1327
std::pair< double, bool > GetMaxValue() const
Alias for GDALAlgorithmArgDecl::GetMaxValue()
Definition gdalalgorithm_cpp.h:1434
bool IsAvailableInPipelineStep() const
Alias for GDALAlgorithmArgDecl::IsAvailableInPipelineStep()
Definition gdalalgorithm_cpp.h:1581
int GetMaxCharCount() const
Alias for GDALAlgorithmArgDecl::GetMaxCharCount()
Definition gdalalgorithm_cpp.h:1446
bool Set(GDALDataType dt)
Set the value for a GAAT_STRING argument from a GDALDataType It cannot be called several times for a ...
Definition gdalalgorithm_cpp.h:1657
const std::vector< std::string > & GetChoices() const
Alias for GDALAlgorithmArgDecl::GetChoices()
Definition gdalalgorithm_cpp.h:1405
void SetSkipIfAlreadySet(bool skip=true)
Advanced method used to make "gdal info" and "gdal raster|vector info" to avoid re-opening an already...
Definition gdalalgorithm_cpp.h:1828
bool GetPackedValuesAllowed() const
Alias for GDALAlgorithmArgDecl::GetPackedValuesAllowed()
Definition gdalalgorithm_cpp.h:1381
bool IsOnlyForCLI() const
Alias for GDALAlgorithmArgDecl::IsOnlyForCLI()
Definition gdalalgorithm_cpp.h:1476
bool IsOutput() const
Alias for GDALAlgorithmArgDecl::IsOutput()
Definition gdalalgorithm_cpp.h:1495
bool GetDuplicateValuesAllowed() const
Alias for GDALAlgorithmArgDecl::GetDuplicateValuesAllowed()
Definition gdalalgorithm_cpp.h:1393
virtual ~GDALAlgorithmArg()
Destructor.
bool HasDefaultValue() const
Alias for GDALAlgorithmArgDecl::HasDefaultValue()
Definition gdalalgorithm_cpp.h:1458
std::vector< std::string > GetAutoCompleteChoices(const std::string ¤tValue) const
Return auto completion choices, if a auto completion function has been registered.
Definition gdalalgorithm_cpp.h:1420
bool IsHidden() const
Alias for GDALAlgorithmArgDecl::IsHidden()
Definition gdalalgorithm_cpp.h:1464
bool Set(const char *value)
Set the value for a GAAT_STRING argument.
Definition gdalalgorithm_cpp.h:1647
bool GetDisplayHintAboutRepetition() const
Alias for GDALAlgorithmArgDecl::GetDisplayHintAboutRepetition()
Definition gdalalgorithm_cpp.h:1375
GDALAlgorithmArgDecl m_decl
Argument declaration.
Definition gdalalgorithm_cpp.h:1860
GDALAlgorithmArg(const GDALAlgorithmArgDecl &decl, T *pValue)
Constructor.
Definition gdalalgorithm_cpp.h:1274
bool IsPositional() const
Alias for GDALAlgorithmArgDecl::IsPositional()
Definition gdalalgorithm_cpp.h:1399
GDALAlgorithmArg & operator=(const std::vector< double > &value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1795
bool AutoOpenDataset() const
Alias for GDALAlgorithmArgDecl::AutoOpenDataset()
Definition gdalalgorithm_cpp.h:1551
bool SkipIfAlreadySet() const
Advanced method used to make "gdal info" and "gdal raster|vector info" to avoid re-opening an already...
Definition gdalalgorithm_cpp.h:1835
const GDALAlgorithmArgDecl & GetDeclaration() const
Return the argument declaration.
Definition gdalalgorithm_cpp.h:1303
GDALAlgorithmArg & operator=(const std::vector< std::string > &value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1802
bool GetRepeatedArgAllowed() const
Alias for GDALAlgorithmArgDecl::GetRepeatedArgAllowed()
Definition gdalalgorithm_cpp.h:1387
GDALAlgorithmArg & operator=(double value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1753
std::pair< double, bool > GetMinValue() const
Alias for GDALAlgorithmArgDecl::GetMinValue()
Definition gdalalgorithm_cpp.h:1428
GDALAlgorithmArgType GetType() const
Alias for GDALAlgorithmArgDecl::GetType()
Definition gdalalgorithm_cpp.h:1345
GDALAlgorithmArg & operator=(GDALDataset *value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1809
const std::string & GetMutualExclusionGroup() const
Alias for GDALAlgorithmArgDecl::GetMutualExclusionGroup()
Definition gdalalgorithm_cpp.h:1513
bool IsHiddenForAPI() const
Alias for GDALAlgorithmArgDecl::IsHiddenForAPI()
Definition gdalalgorithm_cpp.h:1483
bool IsUserProvided() const
Alias for GDALAlgorithmArgDecl::IsUserProvided()
Definition gdalalgorithm_cpp.h:1557
GDALArgDatasetType GetDatasetType() const
Alias for GDALAlgorithmArgDecl::GetDatasetType()
Definition gdalalgorithm_cpp.h:1563
GDALAlgorithmArg & operator=(bool value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1739
bool IsHiddenForCLI() const
Alias for GDALAlgorithmArgDecl::IsHiddenForCLI()
Definition gdalalgorithm_cpp.h:1470
GDALAlgorithmArg & operator=(GDALDataType value)
Set the value of the argument.
Definition gdalalgorithm_cpp.h:1774
const T & GetDefault() const
Alias for GDALAlgorithmArgDecl::GetDefault()
Definition gdalalgorithm_cpp.h:1545
Algorithm information.
Definition gdalalgorithm_cpp.h:2326
std::function m_creationFunc
Creation function.
Definition gdalalgorithm_cpp.h:2334
std::string m_name
Algorithm (short) name.
Definition gdalalgorithm_cpp.h:2329
std::vector< std::string > m_aliases
Aliases.
Definition gdalalgorithm_cpp.h:2331
Registry of GDAL algorithms.
Definition gdalalgorithm_cpp.h:2316
bool empty() const
Returns true if there are no algorithms registered.
Definition gdalalgorithm_cpp.h:2396
std::unique_ptr< GDALAlgorithm > Instantiate(const std::string &first, V &&...rest)
Instantiate an algorithm by its path.
Definition gdalalgorithm_cpp.h:2381
const AlgInfo * GetInfo(const std::string &name) const
Get an algorithm by its name.
Definition gdalalgorithm_cpp.h:2389
bool Register()
Register the algorithm of type MyAlgorithm.
Definition gdalalgorithm_cpp.h:2343
GDAL algorithm.
Definition gdalalgorithm_cpp.h:2445
virtual void WarnIfDeprecated()
Method that an algorithm can implement to issue a warning message about its deprecation.
Definition gdalalgorithm_cpp.h:3199
bool SupportsStreamedOutput() const
Returns whether this algorithm supports a streamed output dataset.
Definition gdalalgorithm_cpp.h:2600
void AddValidationAction(std::function< bool()> f)
Register an action that is executed by the ValidateArguments() method.
Definition gdalalgorithm_cpp.h:3126
const std::string & GetHelpFullURL() const
Get the algorithm full URL, resolving relative URLs.
Definition gdalalgorithm_cpp.h:2478
void SetCallPath(const std::vector< std::string > &path)
Set the calling path to this algorithm.
Definition gdalalgorithm_cpp.h:2570
bool IsJSONUsageRequested() const
Whether the --json-usage flag has been specified.
Definition gdalalgorithm_cpp.h:2695
void SetReferencePathForRelativePaths(const std::string &referencePath)
Set the reference file paths used to interpret relative paths.
Definition gdalalgorithm_cpp.h:2588
bool m_progressBarRequested
Whether a progress bar is requested (value of --progress argument)
Definition gdalalgorithm_cpp.h:2793
bool IsHidden() const
Returns whether this algorithm is hidden.
Definition gdalalgorithm_cpp.h:2484
const std::string & GetLongDescription() const
Get the long algorithm description.
Definition gdalalgorithm_cpp.h:2464
std::vector< std::unique_ptr< GDALAlgorithmArg > > & GetArgs()
Return the potential arguments of the algorithm.
Definition gdalalgorithm_cpp.h:2511
void SetCalledFromCommandLine()
Set whether the algorithm is called from the command line.
Definition gdalalgorithm_cpp.h:2751
bool RegisterSubAlgorithm()
Register the sub-algorithm of type MyAlgorithm.
Definition gdalalgorithm_cpp.h:2834
const std::string & GetDescription() const
Get the algorithm description (a few sentences at most)
Definition gdalalgorithm_cpp.h:2458
ProcessGDALGOutputRet
Return value for ProcessGDALGOutput.
Definition gdalalgorithm_cpp.h:3147
bool IsCalledFromCommandLine() const
Return whether the algorithm is called from the command line.
Definition gdalalgorithm_cpp.h:2757
GDALAlgorithm & GetActualAlgorithm()
Return the actual algorithm that is going to be invoked, when the current algorithm has sub-algorithm...
Definition gdalalgorithm_cpp.h:2681
const GDALAlgorithmArg * GetArg(const std::string &osName, bool suggestionAllowed=false) const
Return an argument from its long name, short name or an alias.
Definition gdalalgorithm_cpp.h:2540
void AllowArbitraryLongNameArgs()
Allow arbitrary user arguments using long name syntax (–something)
Definition gdalalgorithm_cpp.h:2847
GDALAlgorithmArg & operator[](const std::string &osName)
Return an argument from its long name, short name or an alias.
Definition gdalalgorithm_cpp.h:2527
GDALAlgorithmArg * GetArg(const std::string &osName, bool suggestionAllowed=false)
Return an argument from its long name, short name or an alias.
Definition gdalalgorithm_cpp.h:2520
bool m_quiet
Whether a progress bar is disabled (value of --quiet argument)
Definition gdalalgorithm_cpp.h:2796
const std::string & GetHelpURL() const
Get the algorithm help URL.
Definition gdalalgorithm_cpp.h:2472
const std::vector< std::unique_ptr< GDALAlgorithmArg > > & GetArgs() const
Return the potential arguments of the algorithm.
Definition gdalalgorithm_cpp.h:2505
const std::string & GetName() const
Get the algorithm name.
Definition gdalalgorithm_cpp.h:2452
bool RegisterSubAlgorithm(const GDALAlgorithmRegistry::AlgInfo &info)
Register a sub-algoritm by its AlgInfo structure.
Definition gdalalgorithm_cpp.h:2841
void SetParseForAutoCompletion()
Set hint before calling ParseCommandLineArguments() that it must try to be be graceful when possible,...
Definition gdalalgorithm_cpp.h:2579
void SetExecutionForStreamedOutput()
Indicates that the algorithm must be run to generate a streamed output dataset.
Definition gdalalgorithm_cpp.h:2612
const GDALAlgorithmArg & operator[](const std::string &osName) const
Return an argument from its long name, short name or an alias.
Definition gdalalgorithm_cpp.h:2548
bool IsProgressBarRequested() const
Whether the --progress flag has been specified.
Definition gdalalgorithm_cpp.h:2701
const std::string & GetReferencePathForRelativePaths() const
Return the reference file paths used to interpret relative paths.
Definition gdalalgorithm_cpp.h:2594
const std::vector< std::string > & GetAliases() const
Return alias names (generally short) for the current algorithm.
Definition gdalalgorithm_cpp.h:2709
void SetDisplayInJSONUsage(bool b)
Set whether this algorithm should be reported in JSON usage.
Definition gdalalgorithm_cpp.h:3191
bool PropagateSpecialActionTo(GDALAlgorithm *target)
Used by the "gdal info" special algorithm when it first tries to run "gdal raster info",...
Definition gdalalgorithm_cpp.h:2729
bool IsHelpRequested() const
Whether the --help flag has been specified.
Definition gdalalgorithm_cpp.h:2689
Value for an argument that points to a GDALDataset.
Definition gdalalgorithm_cpp.h:163
GDALArgDatasetValue()=default
Default (empty) constructor.
const std::string & GetName() const
Get dataset name.
Definition gdalalgorithm_cpp.h:236
GDALDataset * BorrowDataset()
Borrow the GDALDataset* instance (may be null), leaving its reference counter unchanged.
Definition gdalalgorithm_cpp.h:218
GDALArgDatasetValue(const std::string &name)
Constructor by dataset name.
Definition gdalalgorithm_cpp.h:169
const GDALDataset * GetDatasetRef() const
Get a GDALDataset* instance (may be null).
Definition gdalalgorithm_cpp.h:210
GDALDataset * GetDatasetRef()
Get a GDALDataset* instance (may be null).
Definition gdalalgorithm_cpp.h:201
bool HasDatasetBeenOpenedByAlgorithm() const
Whether the dataset has been opened by the algorithm.
Definition gdalalgorithm_cpp.h:269
void SetOwnerArgument(GDALAlgorithmArg *arg)
Set the argument that owns us.
Definition gdalalgorithm_cpp.h:278
void SetDatasetOpenedByAlgorithm()
Set that the dataset has been opened by the algorithm.
Definition gdalalgorithm_cpp.h:263
bool IsNameSet() const
Return whether a dataset name has been set.
Definition gdalalgorithm_cpp.h:242
void BorrowDatasetFrom(GDALArgDatasetValue &other)
Borrow the GDALDataset* instance from another GDALArgDatasetValue, leaving its reference counter unch...
Definition gdalalgorithm_cpp.h:228
A set of associated raster bands, usually from one file.
Definition gdal_dataset.h:77
Global registry of GDAL algorithms.
Definition gdalalgorithm_cpp.h:3345
std::function< std::unique_ptr< GDALAlgorithm >()> InstantiateFunc
Instantiation function.
Definition gdalalgorithm_cpp.h:3354
Technical class used by GDALAlgorithm when constructing argument declarations.
Definition gdalalgorithm_cpp.h:1918
GDALInConstructionAlgorithmArg & SetMutualDependencyGroup(const std::string &group)
Alias for GDALAlgorithmArgDecl::SetMutualDependencyGroup()
Definition gdalalgorithm_cpp.h:2207
GDALInConstructionAlgorithmArg & SetDatasetInputFlags(int flags)
Alias for GDALAlgorithmArgDecl::SetDatasetInputFlags()
Definition gdalalgorithm_cpp.h:2239
GDALInConstructionAlgorithmArg & SetDefault(const T &value)
Alias for GDALAlgorithmArgDecl::SetDefault()
Definition gdalalgorithm_cpp.h:1969
GDALInConstructionAlgorithmArg & AddAction(std::function< void()> f)
Register an action that is executed, once and exactly once, if the argument is explicitly set,...
Definition gdalalgorithm_cpp.h:2255
GDALInConstructionAlgorithmArg & SetHiddenChoices(T &&first, U &&...rest)
Alias for GDALAlgorithmArgDecl::SetHiddenChoices()
Definition gdalalgorithm_cpp.h:2092
GDALInConstructionAlgorithmArg & SetMaxValueIncluded(double max)
Alias for GDALAlgorithmArgDecl::SetMaxValueIncluded()
Definition gdalalgorithm_cpp.h:2114
GDALInConstructionAlgorithmArg & SetHidden()
Alias for GDALAlgorithmArgDecl::SetHidden()
Definition gdalalgorithm_cpp.h:2142
GDALInConstructionAlgorithmArg & AddDirectDependency(const GDALAlgorithmArg &otherArg)
Add a direct (not mutual) dependency from an argument.
Definition gdalalgorithm_cpp.h:2215
GDALInConstructionAlgorithmArg & SetDatasetOutputFlags(int flags)
Alias for GDALAlgorithmArgDecl::SetDatasetOutputFlags()
Definition gdalalgorithm_cpp.h:2246
GDALInConstructionAlgorithmArg & SetDuplicateValuesAllowed(bool allowed)
Alias for GDALAlgorithmArgDecl::SetDuplicateValuesAllowed()
Definition gdalalgorithm_cpp.h:2065
GDALInConstructionAlgorithmArg & SetReadFromFileAtSyntaxAllowed()
Alias for GDALAlgorithmArgDecl::SetReadFromFileAtSyntaxAllowed()
Definition gdalalgorithm_cpp.h:2177
~GDALInConstructionAlgorithmArg() override
Destructor.
GDALInConstructionAlgorithmArg & SetMinCount(int count)
Alias for GDALAlgorithmArgDecl::SetMinCount()
Definition gdalalgorithm_cpp.h:2029
GDALInConstructionAlgorithmArg & SetIsOutput(bool isOutput=true)
Alias for GDALAlgorithmArgDecl::SetIsOutput()
Definition gdalalgorithm_cpp.h:2170
GDALInConstructionAlgorithmArg & SetRemoveSQLCommentsEnabled()
Alias for GDALAlgorithmArgDecl::SetRemoveSQLCommentsEnabled()
Definition gdalalgorithm_cpp.h:2184
GDALInConstructionAlgorithmArg & SetDefault(const char *value)
Alias for GDALAlgorithmArgDecl::SetDefault()
Definition gdalalgorithm_cpp.h:2023
GDALInConstructionAlgorithmArg & SetMaxCount(int count)
Alias for GDALAlgorithmArgDecl::SetMaxCount()
Definition gdalalgorithm_cpp.h:2036
GDALInConstructionAlgorithmArg & SetMaxValueExcluded(double max)
Alias for GDALAlgorithmArgDecl::SetMaxValueExcluded()
Definition gdalalgorithm_cpp.h:2121
GDALInConstructionAlgorithmArg & SetHiddenForAPI(bool hiddenForAPI=true)
Alias for GDALAlgorithmArgDecl::SetHiddenForAPI()
Definition gdalalgorithm_cpp.h:2156
GDALInConstructionAlgorithmArg & SetDisplayHintAboutRepetition(bool displayHint)
Alias for GDALAlgorithmArgDecl::SetDisplayHintAboutRepetition()
Definition gdalalgorithm_cpp.h:2044
GDALInConstructionAlgorithmArg & SetAvailableInPipelineStep(bool available)
Alias for GDALAlgorithmArgDecl::SetAvailableInPipelineStep()
Definition gdalalgorithm_cpp.h:2295
GDALInConstructionAlgorithmArg & SetAutoOpenDataset(bool autoOpen)
Alias for GDALAlgorithmArgDecl::SetAutoOpenDataset()
Definition gdalalgorithm_cpp.h:2191
GDALInConstructionAlgorithmArg & SetDatasetType(GDALArgDatasetType datasetType)
Alias for GDALAlgorithmArgDecl::SetDatasetType()
Definition gdalalgorithm_cpp.h:2232
GDALInConstructionAlgorithmArg & SetAutoCompleteFunction(std::function< std::vector< std::string >(const std::string &)> f)
Register a function that will return a list of valid choices for the value of the argument.
Definition gdalalgorithm_cpp.h:2276
GDALInConstructionAlgorithmArg & SetPackedValuesAllowed(bool allowed)
Alias for GDALAlgorithmArgDecl::SetPackedValuesAllowed()
Definition gdalalgorithm_cpp.h:2051
GDALInConstructionAlgorithmArg & SetUserProvided()
Alias for GDALAlgorithmArgDecl::SetUserProvided()
Definition gdalalgorithm_cpp.h:2302
GDALInConstructionAlgorithmArg & SetChoices(const std::vector< std::string > &choices)
Alias for GDALAlgorithmArgDecl::SetChoices()
Definition gdalalgorithm_cpp.h:2084
GDALInConstructionAlgorithmArg & SetMaxCharCount(int count)
Alias for GDALAlgorithmArgDecl::SetMaxCharCount()
Definition gdalalgorithm_cpp.h:2135
GDALInConstructionAlgorithmArg & SetMinCharCount(int count)
Alias for GDALAlgorithmArgDecl::SetMinCharCount()
Definition gdalalgorithm_cpp.h:2128
GDALInConstructionAlgorithmArg & SetHiddenForCLI(bool hiddenForCLI=true)
Alias for GDALAlgorithmArgDecl::SetHiddenForCLI()
Definition gdalalgorithm_cpp.h:2149
GDALInConstructionAlgorithmArg & AddMetadataItem(const std::string &name, const std::vector< std::string > &values)
Alias for GDALAlgorithmArgDecl::AddMetadataItem()
Definition gdalalgorithm_cpp.h:2223
GDALInConstructionAlgorithmArg & SetMutualExclusionGroup(const std::string &group)
Alias for GDALAlgorithmArgDecl::SetMutualExclusionGroup()
Definition gdalalgorithm_cpp.h:2199
GDALInConstructionAlgorithmArg & SetMinValueIncluded(double min)
Alias for GDALAlgorithmArgDecl::SetMinValueIncluded()
Definition gdalalgorithm_cpp.h:2100
GDALInConstructionAlgorithmArg & SetChoices(T &&first, U &&...rest)
Alias for GDALAlgorithmArgDecl::SetChoices()
Definition gdalalgorithm_cpp.h:2076
GDALInConstructionAlgorithmArg & SetIsInput(bool isInput=true)
Alias for GDALAlgorithmArgDecl::SetIsInput()
Definition gdalalgorithm_cpp.h:2163
GDALInConstructionAlgorithmArg & SetRequired()
Alias for GDALAlgorithmArgDecl::SetRequired()
Definition gdalalgorithm_cpp.h:1947
GDALInConstructionAlgorithmArg & SetMetaVar(const std::string &metaVar)
Alias for GDALAlgorithmArgDecl::SetMetaVar()
Definition gdalalgorithm_cpp.h:1954
GDALInConstructionAlgorithmArg(GDALAlgorithm *owner, const GDALAlgorithmArgDecl &decl, T *pValue)
Constructor.
Definition gdalalgorithm_cpp.h:1924
GDALInConstructionAlgorithmArg & SetRepeatedArgAllowed(bool allowed)
Alias for GDALAlgorithmArgDecl::SetRepeatedArgAllowed()
Definition gdalalgorithm_cpp.h:2058
GDALInConstructionAlgorithmArg & SetMinValueExcluded(double min)
Alias for GDALAlgorithmArgDecl::SetMinValueExcluded()
Definition gdalalgorithm_cpp.h:2107
GDALInConstructionAlgorithmArg & SetCategory(const std::string &category)
Alias for GDALAlgorithmArgDecl::SetCategory()
Definition gdalalgorithm_cpp.h:1961
GDALInConstructionAlgorithmArg & AddValidationAction(std::function< bool()> f)
Register an action that is executed, once and exactly once, if the argument is explicitly set,...
Definition gdalalgorithm_cpp.h:2267
Definition of an attribute of an OGRFeatureDefn.
Definition ogr_feature.h:72
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
CPL error handling services.
#define CPLAssert(expr)
Assert on an expression.
Definition cpl_error.h:353
CPLErr
Error category / error level.
Definition cpl_error.h:45
@ CE_Failure
Error that prevents the current operation to succeed.
Definition cpl_error.h:60
#define CPLE_AppDefined
Application defined error.
Definition cpl_error.h:108
int CPLErrorNum
Error number.
Definition cpl_error.h:103
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Tag a function to have printf() formatting.
Definition cpl_port.h:1009
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:1101
GDALDataType
Definition gdal.h:48
#define GDAL_OF_RASTER
Allow raster drivers to be used.
Definition gdal.h:1125
#define GDAL_OF_VECTOR
Allow vector drivers to be used.
Definition gdal.h:1130
const char * GDALGetDataTypeName(GDALDataType)
Get name of data type.
Definition gdal_misc.cpp:715
#define GDAL_OF_MULTIDIM_RASTER
Allow multidimensional raster drivers to be used.
Definition gdal.h:1141
void * OGRLayerH
Opaque type for a layer (OGRLayer)
Definition gdal_fwd.h:157
OGRFieldSubType
List of field subtypes.
Definition ogr_core.h:817
OGRFieldType
List of feature field types.
Definition ogr_core.h:790
Usage options.
Definition gdalalgorithm_cpp.h:2649
bool isPipelineStep
Whether this is a pipeline step.
Definition gdalalgorithm_cpp.h:2651
size_t maxOptLen
Maximum width of the names of the options.
Definition gdalalgorithm_cpp.h:2653
bool isPipelineMain
Whether this is a pipeline main.
Definition gdalalgorithm_cpp.h:2655