mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
LibConfig: Add removal/notifcation for keys
This commit is contained in:
parent
a4a89a63cb
commit
b97f9f8e17
4 changed files with 24 additions and 0 deletions
|
@ -31,6 +31,7 @@ public:
|
|||
void write_string(StringView domain, StringView group, StringView key, StringView value);
|
||||
void write_i32(StringView domain, StringView group, StringView key, i32 value);
|
||||
void write_bool(StringView domain, StringView group, StringView key, bool value);
|
||||
void remove_key(StringView domain, StringView group, StringView key);
|
||||
|
||||
static Client& the();
|
||||
|
||||
|
@ -43,6 +44,7 @@ private:
|
|||
void notify_changed_string_value(String const& domain, String const& group, String const& key, String const& value) override;
|
||||
void notify_changed_i32_value(String const& domain, String const& group, String const& key, i32 value) override;
|
||||
void notify_changed_bool_value(String const& domain, String const& group, String const& key, bool value) override;
|
||||
void notify_removed_key(String const& domain, String const& group, String const& key) override;
|
||||
};
|
||||
|
||||
inline String read_string(StringView domain, StringView group, StringView key, StringView fallback = {})
|
||||
|
@ -75,6 +77,11 @@ inline void write_bool(StringView domain, StringView group, StringView key, bool
|
|||
Client::the().write_bool(domain, group, key, value);
|
||||
}
|
||||
|
||||
inline void remove_key(StringView domain, StringView group, StringView key)
|
||||
{
|
||||
Client::the().remove_key(domain, group, key);
|
||||
}
|
||||
|
||||
inline void pledge_domains(Vector<String> const& domains)
|
||||
{
|
||||
Client::the().pledge_domains(domains);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue