mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +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: https://github.com/SerenityOS/serenity/commit/d1dae5f4d1a 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));
|
||||
}
|
||||
|
||||
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