summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibConfig
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-04 18:02:33 +0000
committerAndreas Kling <kling@serenityos.org>2022-12-06 08:54:33 +0100
commit6e19ab2bbce0b113b628e6f8e9b5c0640053933e (patch)
tree372d21b2f5dcff112f5d0089559c6af5798680d4 /Userland/Libraries/LibConfig
parentf74251606d74b504a1379ebb893fdb5529054ea5 (diff)
downloadserenity-6e19ab2bbce0b113b628e6f8e9b5c0640053933e.zip
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
Diffstat (limited to 'Userland/Libraries/LibConfig')
-rw-r--r--Userland/Libraries/LibConfig/Client.cpp22
-rw-r--r--Userland/Libraries/LibConfig/Client.h34
-rw-r--r--Userland/Libraries/LibConfig/Listener.cpp14
-rw-r--r--Userland/Libraries/LibConfig/Listener.h12
4 files changed, 41 insertions, 41 deletions
diff --git a/Userland/Libraries/LibConfig/Client.cpp b/Userland/Libraries/LibConfig/Client.cpp
index 9d026630b2..b0d7b53126 100644
--- a/Userland/Libraries/LibConfig/Client.cpp
+++ b/Userland/Libraries/LibConfig/Client.cpp
@@ -20,27 +20,27 @@ Client& Client::the()
return *s_the;
}
-void Client::pledge_domains(Vector<String> const& domains)
+void Client::pledge_domains(Vector<DeprecatedString> const& domains)
{
async_pledge_domains(domains);
}
-void Client::monitor_domain(String const& domain)
+void Client::monitor_domain(DeprecatedString const& domain)
{
async_monitor_domain(domain);
}
-Vector<String> Client::list_keys(StringView domain, StringView group)
+Vector<DeprecatedString> Client::list_keys(StringView domain, StringView group)
{
return list_config_keys(domain, group);
}
-Vector<String> Client::list_groups(StringView domain)
+Vector<DeprecatedString> Client::list_groups(StringView domain)
{
return list_config_groups(domain);
}
-String Client::read_string(StringView domain, StringView group, StringView key, StringView fallback)
+DeprecatedString Client::read_string(StringView domain, StringView group, StringView key, StringView fallback)
{
return read_string_value(domain, group, key).value_or(fallback);
}
@@ -85,42 +85,42 @@ void Client::add_group(StringView domain, StringView group)
add_group_entry(domain, group);
}
-void Client::notify_changed_string_value(String const& domain, String const& group, String const& key, String const& value)
+void Client::notify_changed_string_value(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value)
{
Listener::for_each([&](auto& listener) {
listener.config_string_did_change(domain, group, key, value);
});
}
-void Client::notify_changed_i32_value(String const& domain, String const& group, String const& key, i32 value)
+void Client::notify_changed_i32_value(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, i32 value)
{
Listener::for_each([&](auto& listener) {
listener.config_i32_did_change(domain, group, key, value);
});
}
-void Client::notify_changed_bool_value(String const& domain, String const& group, String const& key, bool value)
+void Client::notify_changed_bool_value(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, bool value)
{
Listener::for_each([&](auto& listener) {
listener.config_bool_did_change(domain, group, key, value);
});
}
-void Client::notify_removed_key(String const& domain, String const& group, String const& key)
+void Client::notify_removed_key(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key)
{
Listener::for_each([&](auto& listener) {
listener.config_key_was_removed(domain, group, key);
});
}
-void Client::notify_removed_group(String const& domain, String const& group)
+void Client::notify_removed_group(DeprecatedString const& domain, DeprecatedString const& group)
{
Listener::for_each([&](auto& listener) {
listener.config_group_was_removed(domain, group);
});
}
-void Client::notify_added_group(String const& domain, String const& group)
+void Client::notify_added_group(DeprecatedString const& domain, DeprecatedString const& group)
{
Listener::for_each([&](auto& listener) {
listener.config_group_was_added(domain, group);
diff --git a/Userland/Libraries/LibConfig/Client.h b/Userland/Libraries/LibConfig/Client.h
index 1ab9e52ad1..e7c89396aa 100644
--- a/Userland/Libraries/LibConfig/Client.h
+++ b/Userland/Libraries/LibConfig/Client.h
@@ -21,13 +21,13 @@ class Client final
IPC_CLIENT_CONNECTION(Client, "/tmp/session/%sid/portal/config"sv)
public:
- void pledge_domains(Vector<String> const&);
- void monitor_domain(String const&);
+ void pledge_domains(Vector<DeprecatedString> const&);
+ void monitor_domain(DeprecatedString const&);
- Vector<String> list_groups(StringView domain);
- Vector<String> list_keys(StringView domain, StringView group);
+ Vector<DeprecatedString> list_groups(StringView domain);
+ Vector<DeprecatedString> list_keys(StringView domain, StringView group);
- String read_string(StringView domain, StringView group, StringView key, StringView fallback);
+ DeprecatedString read_string(StringView domain, StringView group, StringView key, StringView fallback);
i32 read_i32(StringView domain, StringView group, StringView key, i32 fallback);
bool read_bool(StringView domain, StringView group, StringView key, bool fallback);
@@ -46,25 +46,25 @@ 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;
- void notify_removed_group(String const& domain, String const& group) override;
- void notify_added_group(String const& domain, String const& group) override;
+ void notify_changed_string_value(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value) override;
+ void notify_changed_i32_value(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, i32 value) override;
+ void notify_changed_bool_value(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, bool value) override;
+ void notify_removed_key(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key) override;
+ void notify_removed_group(DeprecatedString const& domain, DeprecatedString const& group) override;
+ void notify_added_group(DeprecatedString const& domain, DeprecatedString const& group) override;
};
-inline Vector<String> list_groups(StringView domain)
+inline Vector<DeprecatedString> list_groups(StringView domain)
{
return Client::the().list_groups(domain);
}
-inline Vector<String> list_keys(StringView domain, StringView group)
+inline Vector<DeprecatedString> list_keys(StringView domain, StringView group)
{
return Client::the().list_keys(domain, group);
}
-inline String read_string(StringView domain, StringView group, StringView key, StringView fallback = {})
+inline DeprecatedString read_string(StringView domain, StringView group, StringView key, StringView fallback = {})
{
return Client::the().read_string(domain, group, key, fallback);
}
@@ -109,17 +109,17 @@ inline void add_group(StringView domain, StringView group)
Client::the().add_group(domain, group);
}
-inline void pledge_domains(Vector<String> const& domains)
+inline void pledge_domains(Vector<DeprecatedString> const& domains)
{
Client::the().pledge_domains(domains);
}
-inline void pledge_domain(String const& domain)
+inline void pledge_domain(DeprecatedString const& domain)
{
Client::the().pledge_domains({ domain });
}
-inline void monitor_domain(String const& domain)
+inline void monitor_domain(DeprecatedString const& domain)
{
Client::the().monitor_domain(domain);
}
diff --git a/Userland/Libraries/LibConfig/Listener.cpp b/Userland/Libraries/LibConfig/Listener.cpp
index 08fafeadc1..0916619d09 100644
--- a/Userland/Libraries/LibConfig/Listener.cpp
+++ b/Userland/Libraries/LibConfig/Listener.cpp
@@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include <AK/DeprecatedString.h>
#include <AK/Function.h>
#include <AK/HashTable.h>
-#include <AK/String.h>
#include <LibConfig/Listener.h>
namespace Config {
@@ -29,27 +29,27 @@ void Listener::for_each(Function<void(Listener&)> callback)
callback(*listener);
}
-void Listener::config_string_did_change(String const&, String const&, String const&, String const&)
+void Listener::config_string_did_change(DeprecatedString const&, DeprecatedString const&, DeprecatedString const&, DeprecatedString const&)
{
}
-void Listener::config_i32_did_change(String const&, String const&, String const&, i32)
+void Listener::config_i32_did_change(DeprecatedString const&, DeprecatedString const&, DeprecatedString const&, i32)
{
}
-void Listener::config_bool_did_change(String const&, String const&, String const&, bool)
+void Listener::config_bool_did_change(DeprecatedString const&, DeprecatedString const&, DeprecatedString const&, bool)
{
}
-void Listener::config_key_was_removed(String const&, String const&, String const&)
+void Listener::config_key_was_removed(DeprecatedString const&, DeprecatedString const&, DeprecatedString const&)
{
}
-void Listener::config_group_was_removed(String const&, String const&)
+void Listener::config_group_was_removed(DeprecatedString const&, DeprecatedString const&)
{
}
-void Listener::config_group_was_added(String const&, String const&)
+void Listener::config_group_was_added(DeprecatedString const&, DeprecatedString const&)
{
}
diff --git a/Userland/Libraries/LibConfig/Listener.h b/Userland/Libraries/LibConfig/Listener.h
index 67820d1be2..467b10f267 100644
--- a/Userland/Libraries/LibConfig/Listener.h
+++ b/Userland/Libraries/LibConfig/Listener.h
@@ -16,12 +16,12 @@ public:
static void for_each(Function<void(Listener&)>);
- virtual void config_string_did_change(String const& domain, String const& group, String const& key, String const& value);
- virtual void config_i32_did_change(String const& domain, String const& group, String const& key, i32 value);
- virtual void config_bool_did_change(String const& domain, String const& group, String const& key, bool value);
- virtual void config_key_was_removed(String const& domain, String const& group, String const& key);
- virtual void config_group_was_removed(String const& domain, String const& group);
- virtual void config_group_was_added(String const& domain, String const& group);
+ virtual void config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value);
+ virtual void config_i32_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, i32 value);
+ virtual void config_bool_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, bool value);
+ virtual void config_key_was_removed(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key);
+ virtual void config_group_was_removed(DeprecatedString const& domain, DeprecatedString const& group);
+ virtual void config_group_was_added(DeprecatedString const& domain, DeprecatedString const& group);
protected:
Listener();