Represents an IPv6 address.
More...
#include <ipv6_address.hpp>
|
using | value_type = std::array<std::uint8_t, value_size> |
|
using | zone_id_type = std::array<char, max_zone_id_size> |
|
|
constexpr | ipv6_address () noexcept |
| Creates an instance.
|
|
constexpr | ipv6_address (std::initializer_list< std::uint8_t > address, std::string_view zone_id="") noexcept |
| Creates an instance from an initializer list.
|
|
constexpr | ipv6_address (std::span< const std::uint8_t, value_size > address, std::string_view zone_id="") noexcept |
| Creates an instance from a 16-byte array.
|
|
constexpr auto | operator<=> (const ipv6_address &) const noexcept=default |
|
constexpr value_type & | get () noexcept |
| Gets the underlying array.
|
|
constexpr const value_type & | get () const noexcept |
| Gets the underlying array.
|
|
constexpr const char * | zone_id () const noexcept |
| Gets the zone ID.
|
|
constexpr void | set_zone_id (std::string_view zone_id) noexcept |
| Sets the zone ID.
|
|
|
static constexpr std::size_t | value_size = 16 |
|
static constexpr std::size_t | value_group_count = value_size / 2 |
|
static constexpr std::size_t | max_zone_id_size = 16 |
| On linux systems, the length of a stringified zone ID must be not longer than 16 bytes including the null-terminating character. On Windows, the zone ID must be a decimal natural number.
|
|
Represents an IPv6 address.
◆ ipv6_address() [1/2]
essence::net::ipv6_address::ipv6_address |
( |
std::initializer_list< std::uint8_t > | address, |
|
|
std::string_view | zone_id = "" ) |
|
inlineconstexprnoexcept |
Creates an instance from an initializer list.
- Parameters
-
address | The IPv6 address. |
zone_id | The zone ID of the scoped address. |
◆ ipv6_address() [2/2]
essence::net::ipv6_address::ipv6_address |
( |
std::span< const std::uint8_t, value_size > | address, |
|
|
std::string_view | zone_id = "" ) |
|
inlineexplicitconstexprnoexcept |
Creates an instance from a 16-byte array.
- Parameters
-
address | The IPv6 address. |
zone_id | The zone ID of the scoped address. |
◆ get() [1/2]
const value_type & essence::net::ipv6_address::get |
( |
| ) |
const |
|
inlinenodiscardconstexprnoexcept |
Gets the underlying array.
- Returns
- The underlying array.
◆ get() [2/2]
value_type & essence::net::ipv6_address::get |
( |
| ) |
|
|
inlinenodiscardconstexprnoexcept |
Gets the underlying array.
- Returns
- The underlying array.
◆ set_zone_id()
void essence::net::ipv6_address::set_zone_id |
( |
std::string_view | zone_id | ) |
|
|
inlineconstexprnoexcept |
Sets the zone ID.
- Parameters
-
◆ zone_id()
const char * essence::net::ipv6_address::zone_id |
( |
| ) |
const |
|
inlinenodiscardconstexprnoexcept |
Gets the zone ID.
- Returns
- The zone ID.
◆ max_zone_id_size
std::size_t essence::net::ipv6_address::max_zone_id_size = 16 |
|
staticconstexpr |
The documentation for this class was generated from the following file: