mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:17:45 +00:00
Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte string. As the null state has already been removed, there are no other particularly hairy blockers in repurposing this type as a byte string (what it _really_ is). This commit is auto-generated: $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \ Meta Ports Ladybird Tests Kernel) $ perl -pie 's/\bDeprecatedString\b/ByteString/g; s/deprecated_string/byte_string/g' $xs $ clang-format --style=file -i \ $(git diff --name-only | grep \.cpp\|\.h) $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
parent
38d62563b3
commit
5e1499d104
1615 changed files with 10257 additions and 10257 deletions
|
@ -38,7 +38,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
static SocketAddress local(DeprecatedString const& address)
|
||||
static SocketAddress local(ByteString const& address)
|
||||
{
|
||||
SocketAddress addr;
|
||||
addr.m_type = Type::Local;
|
||||
|
@ -51,11 +51,11 @@ public:
|
|||
IPv4Address ipv4_address() const { return m_ipv4_address; }
|
||||
u16 port() const { return m_port; }
|
||||
|
||||
DeprecatedString to_deprecated_string() const
|
||||
ByteString to_byte_string() const
|
||||
{
|
||||
switch (m_type) {
|
||||
case Type::IPv4:
|
||||
return DeprecatedString::formatted("{}:{}", m_ipv4_address, m_port);
|
||||
return ByteString::formatted("{}:{}", m_ipv4_address, m_port);
|
||||
case Type::Local:
|
||||
return m_local_address;
|
||||
default:
|
||||
|
@ -91,16 +91,16 @@ private:
|
|||
Type m_type { Type::Invalid };
|
||||
IPv4Address m_ipv4_address;
|
||||
u16 m_port { 0 };
|
||||
DeprecatedString m_local_address;
|
||||
ByteString m_local_address;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct AK::Formatter<Core::SocketAddress> : Formatter<DeprecatedString> {
|
||||
struct AK::Formatter<Core::SocketAddress> : Formatter<ByteString> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, Core::SocketAddress const& value)
|
||||
{
|
||||
return Formatter<DeprecatedString>::format(builder, value.to_deprecated_string());
|
||||
return Formatter<ByteString>::format(builder, value.to_byte_string());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue