27 using std::invalid_argument::invalid_argument;
35 return std::make_tuple(full, std::string_view{});
36 std::string_view key{full.begin(), full.begin() +
tok_pos};
37 std::string_view
rem{full.begin() +
tok_pos + 1, full.end()};
38 return std::make_tuple(key,
rem);
50 T &t, std::string_view prefix, std::span<const std::string_view> options,
51 std::optional<std::span<unsigned>> used = std::nullopt) {
54 for (
const auto &
kv : options) {
std::string_view key
The subkey to resolve next.
std::string_view full_key
Full key string, used for diagnostics.
auto split_key(std::string_view full, char tok='.')
Split the string full on the first occurrence of tok.
void set_params(T &t, std::string_view prefix, std::span< const std::string_view > options, std::optional< std::span< unsigned > > used=std::nullopt)
Overwrites t based on the options that start with prefix.
std::string_view value
The value of the parameter to store.
void set_param(T &t, const json &j)
Update/overwrite the first argument based on the JSON object j.
Represents a parameter value encoded as a string in the format abc.def.key=value.
Custom parameter parsing exception.