1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

Everywhere: Rename to_{string => deprecated_string}() where applicable

This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
This commit is contained in:
Linus Groh 2022-12-06 01:12:49 +00:00 committed by Andreas Kling
parent 6e19ab2bbc
commit 57dc179b1f
597 changed files with 1973 additions and 1972 deletions

View file

@ -191,13 +191,13 @@ ErrorOr<DHCPv4Client::Interfaces> DHCPv4Client::get_discoverable_interfaces()
json.value().as_array().for_each([&ifnames_to_immediately_discover, &ifnames_to_attempt_later](auto& value) {
auto if_object = value.as_object();
if (if_object.get("class_name"sv).to_string() == "LoopbackAdapter")
if (if_object.get("class_name"sv).to_deprecated_string() == "LoopbackAdapter")
return;
auto name = if_object.get("name"sv).to_string();
auto mac = if_object.get("mac_address"sv).to_string();
auto name = if_object.get("name"sv).to_deprecated_string();
auto mac = if_object.get("mac_address"sv).to_deprecated_string();
auto is_up = if_object.get("link_up"sv).to_bool();
auto ipv4_addr_maybe = IPv4Address::from_string(if_object.get("ipv4_address"sv).to_string());
auto ipv4_addr_maybe = IPv4Address::from_string(if_object.get("ipv4_address"sv).to_deprecated_string());
auto ipv4_addr = ipv4_addr_maybe.has_value() ? ipv4_addr_maybe.value() : IPv4Address { 0, 0, 0, 0 };
if (is_up) {
dbgln_if(DHCPV4_DEBUG, "Found adapter '{}' with mac {}, and it was up!", name, mac);
@ -216,7 +216,7 @@ ErrorOr<DHCPv4Client::Interfaces> DHCPv4Client::get_discoverable_interfaces()
void DHCPv4Client::handle_offer(DHCPv4Packet const& packet, ParsedDHCPv4Options const& options)
{
dbgln("We were offered {} for {}", packet.yiaddr().to_string(), options.get<u32>(DHCPOption::IPAddressLeaseTime).value_or(0));
dbgln("We were offered {} for {}", packet.yiaddr().to_deprecated_string(), options.get<u32>(DHCPOption::IPAddressLeaseTime).value_or(0));
auto* transaction = const_cast<DHCPv4Transaction*>(m_ongoing_transactions.get(packet.xid()).value_or(nullptr));
if (!transaction) {
dbgln("we're not looking for {}", packet.xid());
@ -237,8 +237,8 @@ void DHCPv4Client::handle_offer(DHCPv4Packet const& packet, ParsedDHCPv4Options
void DHCPv4Client::handle_ack(DHCPv4Packet const& packet, ParsedDHCPv4Options const& options)
{
if constexpr (DHCPV4CLIENT_DEBUG) {
dbgln("The DHCP server handed us {}", packet.yiaddr().to_string());
dbgln("Here are the options: {}", options.to_string());
dbgln("The DHCP server handed us {}", packet.yiaddr().to_deprecated_string());
dbgln("Here are the options: {}", options.to_deprecated_string());
}
auto* transaction = const_cast<DHCPv4Transaction*>(m_ongoing_transactions.get(packet.xid()).value_or(nullptr));
@ -270,8 +270,8 @@ void DHCPv4Client::handle_ack(DHCPv4Packet const& packet, ParsedDHCPv4Options co
void DHCPv4Client::handle_nak(DHCPv4Packet const& packet, ParsedDHCPv4Options const& options)
{
dbgln("The DHCP server told us to go chase our own tail about {}", packet.yiaddr().to_string());
dbgln("Here are the options: {}", options.to_string());
dbgln("The DHCP server told us to go chase our own tail about {}", packet.yiaddr().to_deprecated_string());
dbgln("Here are the options: {}", options.to_deprecated_string());
// make another request a bit later :shrug:
auto* transaction = const_cast<DHCPv4Transaction*>(m_ongoing_transactions.get(packet.xid()).value_or(nullptr));
if (!transaction) {
@ -293,7 +293,7 @@ void DHCPv4Client::process_incoming(DHCPv4Packet const& packet)
{
auto options = packet.parse_options();
dbgln_if(DHCPV4CLIENT_DEBUG, "Here are the options: {}", options.to_string());
dbgln_if(DHCPV4CLIENT_DEBUG, "Here are the options: {}", options.to_deprecated_string());
auto value_or_error = options.get<DHCPMessageType>(DHCPOption::DHCPMessageType);
if (!value_or_error.has_value())
@ -332,7 +332,7 @@ void DHCPv4Client::dhcp_discover(InterfaceDescriptor const& iface)
if constexpr (DHCPV4CLIENT_DEBUG) {
dbgln("Trying to lease an IP for {} with ID {}", iface.ifname, transaction_id);
if (!iface.current_ip_address.is_zero())
dbgln("going to request the server to hand us {}", iface.current_ip_address.to_string());
dbgln("going to request the server to hand us {}", iface.current_ip_address.to_deprecated_string());
}
DHCPv4PacketBuilder builder;
@ -360,7 +360,7 @@ void DHCPv4Client::dhcp_discover(InterfaceDescriptor const& iface)
void DHCPv4Client::dhcp_request(DHCPv4Transaction& transaction, DHCPv4Packet const& offer)
{
auto& iface = transaction.interface;
dbgln("Leasing the IP {} for adapter {}", offer.yiaddr().to_string(), iface.ifname);
dbgln("Leasing the IP {} for adapter {}", offer.yiaddr().to_deprecated_string(), iface.ifname);
DHCPv4PacketBuilder builder;
DHCPv4Packet& packet = builder.peek();