getStringAtOptS#
Fully qualified name: carb::settings::getStringAtOptS
Defined in carb/settings/SettingsUtils.h
- inline cpp::optional<std::string> carb::settings::getStringAtOptS(
- const ISettings *settings,
- carb::cpp::string_view path,
- size_t index,
Retrieves a std::string from an array of string-type setting for simplicity.
Equivalent to:
auto p = settings->getStringBufferAtS(path, index); return p ? std::string(p) : defaultValue;
See also
- Parameters:
settings – The acquired ISettings interface.
path – The setting key path to retrieve (must be an array of strings or
defaultValue
will be returned).index – The array index to retrieve.
- 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.