AK: Implement IPv4Address::to_string_reversed()

This commit is contained in:
Max Wipfli 2021-06-07 14:15:06 +02:00 committed by Ali Mohammad Pur
parent a4d5745e2f
commit d1dae5f4d1
Notes: sideshowbarker 2024-07-18 12:33:52 +09:00

View file

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