29 #ifndef NVXIO_OPTIONHANDLER_HPP
30 #define NVXIO_OPTIONHANDLER_HPP
32 #include <NVXIO/Export.hpp>
58 typedef std::initializer_list<std::pair<std::string, T>> type;
62 typedef std::unique_ptr<OptionHandler>
ptr;
70 virtual std::string getPlaceholder()
const = 0;
76 virtual std::string getConstraintString()
const;
82 virtual std::string getDefaultString()
const = 0;
89 virtual std::string processValue(
const std::string &valueStr)
const = 0;
100 static ptr string(std::string *result);
112 static ptr integer(
int *result,
const Range<int> &validRange = ranges::all<int>());
121 static ptr unsignedInteger(
unsigned *result,
const Range<unsigned> &validRange = ranges::all<unsigned>());
130 static ptr real(
float *result,
const Range<float> &validRange = ranges::all<float>());
139 static ptr real(
double *result,
const Range<double> &validRange = ranges::all<double>());
151 static ptr oneOf(std::string *result, std::initializer_list<std::string> allowedValues);
161 template <
typename T,
typename It>
162 static ptr oneOf(T *result, It first, It last);
181 template <
typename T>
182 static ptr oneOf(T *result,
typename PairList<T>::type allowedValues);
187 #include "detail/OptionHandler.hpp"
189 #endif // NVXIO_OPTIONHANDLER_HPP
The Range interface and utility functions.
std::unique_ptr< OptionHandler > ptr