1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:27:35 +00:00

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 :^)
This commit is contained in:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -151,7 +151,7 @@ struct ParsedDHCPv4Options {
return values;
}
String to_string() const
DeprecatedString to_string() const
{
StringBuilder builder;
builder.append("DHCP Options ("sv);

View file

@ -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);

View file

@ -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;

View file

@ -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");