InterpretValue

Interpret a raw configuration value according to a key and its flags.

Synopsis

Declared in <common/args.h>

std::optional<common::SettingsValue>
InterpretValue(
    KeyInfo const& key,
    std::string const* value,
    unsigned int flags,
    std::string& error);

Return Value

The interpreted setting value, or std::nullopt on error.

Parameters

NameDescription
keyThe parsed key the value belongs to.
valueThe raw value string, or nullptr if no value was given.
flagsArgument flags controlling validation and interpretation.
errorPopulated with a message if interpretation fails.