getStringFromItemValue#

Fully qualified name: carb::settings::getStringFromItemValue

Defined in carb/settings/SettingsUtils.h

inline std::string carb::settings::getStringFromItemValue(
const ISettings *settings,
const char *path,
const std::string &defaultValue = "",
)#

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

Typically to retrieve a string value from carb::dictionary::Item, ISettings::createStringBufferFromItemValue() 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.