Commit graph

4 commits

Author SHA1 Message Date
Peter Brottveit Bock 49b29332f2 AK: Migrate IPv6Address::to_deprecated_string() to ::to_string()
Change the name and return type of
`IPv6Address::to_deprecated_string()` to `IPv6Address::to_string()`
with return type `ErrorOr<String>`.

It will now propagate errors that occur when writing to the
StringBuilder.

There are two users of `to_deprecated_string()` that now use
`to_string()`:

1. `Formatted<IPv6Address>`: it now propagates errors.

2. `inet_ntop`: it now sets errno to ENOMEM and returns.
2023-06-09 19:38:14 +01:00
Peter Brottveit Bock 43a8a38f57 AK: Test that IPv6Address::operator== only looks at bytes in address
This commit extends the test to ensure that different objects with
the same inet6-address are considered equal.
2023-06-09 19:38:14 +01:00
Linus Groh 57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Tom 2f0e3da142 AK: Add IPv6Address class
This is the IPv6 counter part to the IPv4Address class and implements
parsing strings into a in6_addr and formatting one as a string. It
supports the address compression scheme as well as IPv4 mapped
addresses.
2022-03-08 23:05:44 +01:00