getStringFromItemValueS#

Fully qualified name: carb::settings::getStringFromItemValueS

Defined in carb/settings/SettingsUtils.h

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

Retrieves a std::string from a setting key for simplicity.

Typically to retrieve a string value from carb::dictionary::Item, ISettings::createStringBufferFromItemValueS() must be called, but this means that ISettings::destroyStringBuffer() must be called when finished. This function instead returns a std::string.

Parameters:
  • settings – The acquired ISettings interface.

  • path – The setting key path to retrieve.

  • defaultValue – The value that is returned if path is not a valid path.

Returns:

A std::string representation of the item value.