getStringOpt#
Fully qualified name: carb::settings::getStringOpt
Defined in carb/settings/SettingsUtils.h
- inline cpp::optional<std::string> carb::settings::getStringOpt(
- const ISettings *settings,
- const char *path,
Retrieves a std::string from a string-type setting for simplicity.
Equivalent to:
auto p = settings->getStringBuffer(path); return p ? std::string(p) : defaultValue;
See also
- Parameters:
settings – The acquired ISettings interface.
path – The setting key path to retrieve (must be a string or
defaultValue
will be returned).
- Returns:
A
cpp::optional
object that both indicates whether the requested value could be retrieved and thestd::string
representation of the item value itself if the value could be retrieved.