settings#

Fully qualified name: carb::settings

namespace settings#

Namespace for carb::settings::ISettings interface and utilities.

Classes#

ISettings

The Carbonite Settings interface.

ScopedRead

A helper class for performing a scoped read lock on the settings database.

ScopedSubscription

Helper class to add a setting node or tree change subscription that will be automatically unregistered when the object goes out of scope.

ScopedWrite

A helper class for performing a scoped write lock on the settings database.

ThreadSafeLocalCache

A utility for caching a setting and automatically subscribing to changes of the value, as opposed to constantly polling.

Functions#

void appendToStringArray(const cpp::string_view path, const std::vector< std::string > &values)

Appends a set of string values to the end of a setting key.

T getSettingOrDefault(const cpp::string_view path, T defaultValue={})

Access a setting key if present, otherwise returning a default value.

cpp::zstring_view getSettingOrDefault(const cpp::string_view path, cpp::zstring_view defaultValue={})

Access a setting key if present, otherwise returning a default value.

omni::string getString(const ISettings *settings, cpp::string_view path, cpp::string_view defaultValue={})

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

std::vector< std::string > getStringArray(ISettings *settings, cpp::string_view path, cpp::string_view defaultValue={})

A helper function for reading a setting value that is an array of string values as std::vector<std::string> .

std::vector< std::string > getStringArrayFromItemValues(const ISettings *settings, cpp::string_view path, cpp::string_view defaultValue={})

A helper function for reading a setting value that is an array of mixed values as std::vector<std::string> .

omni::string getStringAt(const ISettings *settings, cpp::string_view path, size_t index, cpp::string_view defaultValue={})

Retrieves a string from an array of string-type setting for simplicity.

cpp::optional< omni::string > getStringAtOpt(const ISettings *settings, cpp::string_view path, size_t index)

Retrieves a string from an array of string-type setting for simplicity.

omni::string getStringFromItemValue(const ISettings *settings, cpp::string_view path, cpp::string_view defaultValue={})

Retrieves a string from a setting key for simplicity.

omni::string getStringFromItemValueAt(const ISettings *settings, cpp::string_view path, size_t index, cpp::string_view defaultValue={})

Retrieves a string from an array setting key for simplicity.

cpp::optional< omni::string > getStringOpt(const ISettings *settings, cpp::string_view path)

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

void loadSettingsFromFile(ISettings *settings, cpp::string_view path, dictionary::IDictionary *dictionary, dictionary::ISerializer *serializer, cpp::zstring_view filename)

A helper function to load settings from a file.

void saveFileFromSettings(const ISettings *settings, dictionary::ISerializer *serializer, cpp::string_view path, cpp::zstring_view filename, dictionary::SerializerOptions serializerOptions)

A helper function to save settings to a file.

cpp::zstring_view setDefaultAndGetSetting(const cpp::string_view path, const cpp::zstring_view defaultValue={})

Sets a default value for a setting key and returns the current value.

T setDefaultAndGetSetting(const cpp::string_view path, T defaultValue={})

Sets a default value for a setting key and returns the current value.

void setStringArray(ISettings *settings, cpp::string_view path, const std::vector< std::string > &array)

A helper function for setting a std::vector<std::string> as an array of strings.

void walkSettings(dictionary::IDictionary *idict, settings::ISettings *settings, dictionary::WalkerMode walkerMode, cpp::string_view rootPath, ElementData rootElementData, OnItemFnTypeS onItemFnS)

A function for walking all of the settings from a given root.

Structs#

Transaction

An opaque type representing a settings transaction.