|
RADLib
RADical C++ application framework
|
RADSettings is the public settings library for application configuration. It stores key/value settings in JSON or INI files and layers typed accessors over RADCore::RADJsonValue.
RADSettings::Settings is the store. It can be constructed with an explicit fileName and RADSettings::Format (Json or Ini), or with a RADSettings::AppIdentity (organization and application), in which case it resolves a standard platform config path. fileName() and format() report the backing file, load() reads it (treating a missing file as empty), and save() writes it, creating parent directories as needed. The static Settings::defaultFileName() returns the resolved config path for an identity without constructing a store.
Key management uses contains(), remove(), and clear(). Values can be read and written generically through value() / setValue() with RADCore::RADJsonValue, or through the typed helpers: boolValue(), intValue(), doubleValue(), and stringValue() for reads, and setBool(), setInt(), setDouble(), and setString() for writes. Each typed getter takes a default that is returned when the key is absent.
Core features:
RADCore::RADJsonValue.Example: