diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-04 18:02:33 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-06 08:54:33 +0100 |
commit | 6e19ab2bbce0b113b628e6f8e9b5c0640053933e (patch) | |
tree | 372d21b2f5dcff112f5d0089559c6af5798680d4 /Userland/Services/DHCPClient | |
parent | f74251606d74b504a1379ebb893fdb5529054ea5 (diff) | |
download | serenity-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/Services/DHCPClient')
-rw-r--r-- | Userland/Services/DHCPClient/DHCPv4.h | 2 | ||||
-rw-r--r-- | Userland/Services/DHCPClient/DHCPv4Client.cpp | 6 | ||||
-rw-r--r-- | Userland/Services/DHCPClient/DHCPv4Client.h | 8 | ||||
-rw-r--r-- | Userland/Services/DHCPClient/main.cpp | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/Userland/Services/DHCPClient/DHCPv4.h b/Userland/Services/DHCPClient/DHCPv4.h index 8cf3ce2e9f..50403abd9d 100644 --- a/Userland/Services/DHCPClient/DHCPv4.h +++ b/Userland/Services/DHCPClient/DHCPv4.h @@ -151,7 +151,7 @@ struct ParsedDHCPv4Options { return values; } - String to_string() const + DeprecatedString to_string() const { StringBuilder builder; builder.append("DHCP Options ("sv); diff --git a/Userland/Services/DHCPClient/DHCPv4Client.cpp b/Userland/Services/DHCPClient/DHCPv4Client.cpp index 91af46a8be..9631b33cb5 100644 --- a/Userland/Services/DHCPClient/DHCPv4Client.cpp +++ b/Userland/Services/DHCPClient/DHCPv4Client.cpp @@ -18,14 +18,14 @@ #include <LibCore/Timer.h> #include <stdio.h> -static u8 mac_part(Vector<String> const& parts, size_t index) +static u8 mac_part(Vector<DeprecatedString> const& parts, size_t index) { auto result = AK::StringUtils::convert_to_uint_from_hex(parts.at(index)); VERIFY(result.has_value()); return result.value(); } -static MACAddress mac_from_string(String const& str) +static MACAddress mac_from_string(DeprecatedString const& str) { auto chunks = str.split(':'); VERIFY(chunks.size() == 6); // should we...worry about this? @@ -117,7 +117,7 @@ static void set_params(InterfaceDescriptor const& iface, IPv4Address const& ipv4 } } -DHCPv4Client::DHCPv4Client(Vector<String> interfaces_with_dhcp_enabled) +DHCPv4Client::DHCPv4Client(Vector<DeprecatedString> interfaces_with_dhcp_enabled) : m_interfaces_with_dhcp_enabled(move(interfaces_with_dhcp_enabled)) { m_server = Core::UDPServer::construct(this); diff --git a/Userland/Services/DHCPClient/DHCPv4Client.h b/Userland/Services/DHCPClient/DHCPv4Client.h index 7cf6fb1392..ec318b18de 100644 --- a/Userland/Services/DHCPClient/DHCPv4Client.h +++ b/Userland/Services/DHCPClient/DHCPv4Client.h @@ -7,10 +7,10 @@ #pragma once #include "DHCPv4.h" +#include <AK/DeprecatedString.h> #include <AK/Error.h> #include <AK/HashMap.h> #include <AK/OwnPtr.h> -#include <AK/String.h> #include <AK/Vector.h> #include <LibCore/UDPServer.h> #include <net/if.h> @@ -19,7 +19,7 @@ #include <sys/socket.h> struct InterfaceDescriptor { - String ifname; + DeprecatedString ifname; MACAddress mac_address; IPv4Address current_ip_address; }; @@ -54,11 +54,11 @@ public: static ErrorOr<Interfaces> get_discoverable_interfaces(); private: - explicit DHCPv4Client(Vector<String> interfaces_with_dhcp_enabled); + explicit DHCPv4Client(Vector<DeprecatedString> interfaces_with_dhcp_enabled); void try_discover_ifs(); - Vector<String> m_interfaces_with_dhcp_enabled; + Vector<DeprecatedString> m_interfaces_with_dhcp_enabled; HashMap<u32, OwnPtr<DHCPv4Transaction>> m_ongoing_transactions; RefPtr<Core::UDPServer> m_server; RefPtr<Core::Timer> m_check_timer; diff --git a/Userland/Services/DHCPClient/main.cpp b/Userland/Services/DHCPClient/main.cpp index a4dc24865e..cfcb2118d4 100644 --- a/Userland/Services/DHCPClient/main.cpp +++ b/Userland/Services/DHCPClient/main.cpp @@ -12,7 +12,7 @@ ErrorOr<int> serenity_main(Main::Arguments args) { - Vector<String> interfaces; + Vector<DeprecatedString> interfaces; Core::ArgsParser parser; parser.add_positional_argument(interfaces, "Interfaces to run DHCP server on", "interfaces"); |