Settings.h header

#include <ew/app/Settings.h>

Namespace ew::app

Settings class

class ew::app::Settings

Key/value application settings (theme, recent projects, window state, ...). An interface so the UI depends on the abstraction and tests use an in-memory implementation (CODING_STANDARDS section 7: seams are interfaces).

Members

ew::app::Settings::Settings()=default

Defaulted.

virtual ew::app::Settings::~Settings()=default

Defaulted.

ew::app::Settings::Settings(const Settings &)=delete

Interface type: non-copyable and non-movable (held via pointer/reference).

ew::app::Settings::Settings(Settings &&)=delete

Not movable.

Settings & ew::app::Settings::operator=(const Settings &)=delete

Not copyable.

Settings & ew::app::Settings::operator=(Settings &&)=delete

Not movable.

virtual std::optional< QString > ew::app::Settings::value(QStringView key) const =0

Returns the value stored for key, or std::nullopt if none is set.

virtual void ew::app::Settings::setValue(QStringView key, const QString &value)=0

Stores value under key, replacing any existing value.

virtual bool ew::app::Settings::contains(QStringView key) const =0

Returns true if a value is stored for key.

virtual void ew::app::Settings::remove(QStringView key)=0

Removes the value stored for key, if any.