carb::settings::getString

Defined in carb/settings/SettingsUtils.h

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

Retrieves a std::string from a string-type setting for simplicity.

Equivalent to:

auto p = settings->getStringBuffer(path); return p ? std::string(p) : defaultValue;

See also

ISettings::getStringBuffer, getStringAt()

Parameters
  • settings – The acquired ISettings interface.

  • path – The setting key path to retrieve (must be a string or defaultValue will be returned).

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

Returns

A std::string representation of the item value.