|
VIPA 0.1.0
Header-only C++23 SIMD-assisted IPv4/IPv6 text parser.
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | IPv4Address |
| Parsed IPv4 address in network byte order. More... | |
| struct | IPv6Address |
| Parsed IPv6 address in network byte order. More... | |
| struct | ParseResult |
| Address parser result with the concrete address family. More... | |
Typedefs | |
| using | Address = std::variant<IPv4Address, IPv6Address> |
| Parsed IPv4 or IPv6 address value. | |
Enumerations | |
| enum class | AddressFamily : uint8_t { IPv4 , IPv6 } |
| Parsed IP address family. More... | |
Functions | |
| auto | parse_ipv4 (std::string_view text) noexcept -> std::optional< IPv4Address > |
| Parse strict dotted-decimal IPv4 text. | |
| template<std::size_t N> | |
| auto | parse_ipv4 (const char(&text)[N]) noexcept -> std::optional< IPv4Address > |
| Parse a fixed character array as IPv4 text. | |
| auto | parse_ipv6 (std::string_view text) noexcept -> std::optional< IPv6Address > |
| Parse IPv6 text into sixteen network-order bytes. | |
| auto | parse_address (std::string_view text) noexcept -> std::optional< ParseResult > |
| Parse an IPv4 or IPv6 text address. | |
| using llmx::vipa::Address = std::variant<IPv4Address, IPv6Address> |
Parsed IPv4 or IPv6 address value.
|
strong |
|
inlinenodiscardnoexcept |
Parse an IPv4 or IPv6 text address.
IPv4 parsing is attempted first. On success, the returned family identifies which variant member is stored in the result.
| text | Address text to parse. |
|
inlinenodiscardnoexcept |
Parse a fixed character array as IPv4 text.
A trailing NUL byte is excluded from the parsed view when present.
|
inlinenodiscardnoexcept |
Parse strict dotted-decimal IPv4 text.
Accepted addresses contain exactly four decimal octets separated by dots. Leading-zero multi-digit octets and values above 255 are rejected.
| text | IPv4 address text. |
|
inlinenodiscardnoexcept |
Parse IPv6 text into sixteen network-order bytes.
Supports full and ::-compressed forms, including IPv4-embedded tails. Rejects malformed text, multiple compression markers, invalid hexadecimal groups, overlong addresses, and invalid IPv4 tails.
| text | IPv6 address text. |