1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

LibConfig+LibCore+ConfigServer: Support u32 configuration entries

This commit is contained in:
Timothy Flynn 2022-12-20 07:12:21 -05:00 committed by Andreas Kling
parent 49f697ed56
commit 69beda23c3
10 changed files with 88 additions and 16 deletions

View file

@ -50,6 +50,11 @@ i32 Client::read_i32(StringView domain, StringView group, StringView key, i32 fa
return read_i32_value(domain, group, key).value_or(fallback);
}
u32 Client::read_u32(StringView domain, StringView group, StringView key, u32 fallback)
{
return read_u32_value(domain, group, key).value_or(fallback);
}
bool Client::read_bool(StringView domain, StringView group, StringView key, bool fallback)
{
return read_bool_value(domain, group, key).value_or(fallback);
@ -65,6 +70,11 @@ void Client::write_i32(StringView domain, StringView group, StringView key, i32
write_i32_value(domain, group, key, value);
}
void Client::write_u32(StringView domain, StringView group, StringView key, u32 value)
{
write_u32_value(domain, group, key, value);
}
void Client::write_bool(StringView domain, StringView group, StringView key, bool value)
{
write_bool_value(domain, group, key, value);
@ -99,6 +109,13 @@ void Client::notify_changed_i32_value(DeprecatedString const& domain, Deprecated
});
}
void Client::notify_changed_u32_value(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, u32 value)
{
Listener::for_each([&](auto& listener) {
listener.config_u32_did_change(domain, group, key, value);
});
}
void Client::notify_changed_bool_value(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, bool value)
{
Listener::for_each([&](auto& listener) {