1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +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

@ -26,7 +26,7 @@ void ConnectionFromClient::die()
s_connections.remove(client_id());
}
Messages::LookupServer::LookupNameResponse ConnectionFromClient::lookup_name(String const& name)
Messages::LookupServer::LookupNameResponse ConnectionFromClient::lookup_name(DeprecatedString const& name)
{
auto maybe_answers = LookupServer::the().lookup(name, RecordType::A);
if (maybe_answers.is_error()) {
@ -35,19 +35,19 @@ Messages::LookupServer::LookupNameResponse ConnectionFromClient::lookup_name(Str
}
auto answers = maybe_answers.release_value();
Vector<String> addresses;
Vector<DeprecatedString> addresses;
for (auto& answer : answers) {
addresses.append(answer.record_data());
}
return { 0, move(addresses) };
}
Messages::LookupServer::LookupAddressResponse ConnectionFromClient::lookup_address(String const& address)
Messages::LookupServer::LookupAddressResponse ConnectionFromClient::lookup_address(DeprecatedString const& address)
{
if (address.length() != 4)
return { 1, String() };
return { 1, DeprecatedString() };
IPv4Address ip_address { (u8 const*)address.characters() };
auto name = String::formatted("{}.{}.{}.{}.in-addr.arpa",
auto name = DeprecatedString::formatted("{}.{}.{}.{}.in-addr.arpa",
ip_address[3],
ip_address[2],
ip_address[1],
@ -56,12 +56,12 @@ Messages::LookupServer::LookupAddressResponse ConnectionFromClient::lookup_addre
auto maybe_answers = LookupServer::the().lookup(name, RecordType::PTR);
if (maybe_answers.is_error()) {
dbgln("LookupServer: Failed to lookup PTR record: {}", maybe_answers.error());
return { 1, String() };
return { 1, DeprecatedString() };
}
auto answers = maybe_answers.release_value();
if (answers.is_empty())
return { 1, String() };
return { 1, DeprecatedString() };
return { 0, answers[0].record_data() };
}
}