Options

class Options

A value. Validated against the registry at every write. Every setter is named by its type, so no literal can pick the wrong overload. Unknown names are OPTION_UNKNOWN; bad values OPTION_VALUE.

Public Functions

Options()

every entry at its default

Options(const Options&)
Options(Options&&) noexcept
Options &operator=(const Options&)
Options &operator=(Options&&) noexcept
~Options()
void set(std::string_view name, std::string_view value)
void set_bool(std::string_view name, bool)
void set_int(std::string_view name, std::int64_t)
void set_uint(std::string_view name, std::uint64_t)
void set_str(std::string_view name, std::string_view)

string/enum/mode/path

void set_names(std::string_view name, const std::vector<std::string>&)

set-typed

void set_duration(std::string_view name, std::chrono::milliseconds)

-1 ms is “none” (no limit); any other negative duration is OPTION_VALUE.

void set_bool(Option, bool)
void set_int(Option, std::int64_t)
void set_uint(Option, std::uint64_t)
void set_str(Option, std::string_view)
void set_duration(Option, std::chrono::milliseconds)
void set_args(const std::vector<std::string> &argv)
void set_args(int argc, const char *const *argv)
OptionValue get(std::string_view name) const
bool get_bool(std::string_view name) const
std::int64_t get_int(std::string_view name) const
std::uint64_t get_uint(std::string_view name) const
std::string get_str(std::string_view name) const
std::vector<std::string> get_names(std::string_view name) const
std::chrono::milliseconds get_duration(std::string_view name) const

-1 ms for “none” (no limit, max-time’s default).

OptionValue resolved(std::string_view name) const

after implications

bool is_set(std::string_view name) const
void reset(std::string_view name)
void reset_all()
OptionInfo info(std::string_view name) const
std::vector<std::string> names(std::optional<Tier> = std::nullopt) const
std::string help(std::optional<Tier> = std::nullopt) const
void resolve() const

Applies implied_by/follows, checks excludes (OPTION_CONFLICT) and requires (OPTION_UNAVAILABLE). Solver calls it at construction and before every check.

Public Static Functions

static std::string name_of(Option)
static std::optional<Option> stable_option(std::string_view name)