getStringAtS#

Fully qualified name: carb::settings::getStringAtS

Defined in carb/settings/SettingsUtils.h

inline std::string carb::settings::getStringAtS(
const ISettings *settings,
carb::cpp::string_view path,
size_t index,
carb::cpp::string_view defaultValue = "",
)#

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;

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.

  • defaultValue – The value that is returned if path is not a valid path, not an array of strings, or the index does not exist.

Returns:

A std::string representation of the item value.