mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 18:15:58 +00:00
AK: Implement IPv4Address::to_string_reversed()
This commit is contained in:
parent
a4d5745e2f
commit
d1dae5f4d1
|
@ -57,6 +57,15 @@ public:
|
|||
octet(SubnetClass::D));
|
||||
}
|
||||
|
||||
String to_string_reversed() const
|
||||
{
|
||||
return String::formatted("{}.{}.{}.{}",
|
||||
octet(SubnetClass::D),
|
||||
octet(SubnetClass::C),
|
||||
octet(SubnetClass::B),
|
||||
octet(SubnetClass::A));
|
||||
}
|
||||
|
||||
static Optional<IPv4Address> from_string(const StringView& string)
|
||||
{
|
||||
if (string.is_null())
|
||||
|
|
Loading…
Reference in a new issue