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->getStringBufferS(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
defaultValuewill be returned).
- Returns:
A
cpp::optionalobject that both indicates whether the requested value could be retrieved and thestd::stringrepresentation of the item value itself if the value could be retrieved.