mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 09:06:08 +00:00
AK: Implement IPv4Address::to_string_reversed()
This commit is contained in:
parent
a4d5745e2f
commit
d1dae5f4d1
Notes:
sideshowbarker
2024-07-18 12:33:52 +09:00
Author: https://github.com/MaxWipfli
Commit: d1dae5f4d1
Pull-request: https://github.com/SerenityOS/serenity/pull/7875
Reviewed-by: https://github.com/FireFox317
Reviewed-by: https://github.com/gunnarbeutner
1 changed files with 9 additions and 0 deletions
|
@ -57,6 +57,15 @@ public:
|
||||||
octet(SubnetClass::D));
|
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)
|
static Optional<IPv4Address> from_string(const StringView& string)
|
||||||
{
|
{
|
||||||
if (string.is_null())
|
if (string.is_null())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue