|
Botan 3.13.0
Crypto and TLS for C&
|
#include <uri.h>
Public Types | |
| using | Host = std::variant<DNSName, IPv4Address, IPv6Address> |
| enum class | HostKind : uint8_t { DNS = 0 , IPv4 = 1 , IPv6 = 2 } |
Public Member Functions | |
| const Host & | host () const |
| HostKind | host_kind () const |
| std::string | host_to_string () const |
| std::strong_ordering | operator<=> (const Authority &other) const |
| bool | operator== (const Authority &other) const |
| const std::string & | original_input () const |
| std::optional< uint16_t > | port () const |
| const std::optional< std::string > & | userinfo () const |
Static Public Member Functions | |
| static std::optional< Authority > | from_string (std::string_view raw) |
The optional authority component of a URI: a validated DNS name, IPv4 literal, or IPv6 literal, with an optional port.
| using Botan::URI::Authority::Host = std::variant<DNSName, IPv4Address, IPv6Address> |
|
strong |
|
static |
Parse a bare authority "host[:port]" or "[ipv6][:port]". Returns nullopt for any parse failure.
Definition at line 248 of file uri.cpp.
References Botan::DNSName::from_string(), Botan::IPv4Address::from_string(), Botan::IPv6Address::from_string(), host(), original_input(), Botan::URI::original_input(), port(), and userinfo().
Referenced by Botan::URI::from_string(), and Botan::OS::open_socket_udp().
|
inline |
Parsed host: a DNS name, an IPv4 literal, or an IPv6 literal.
Definition at line 56 of file uri.h.
Referenced by from_string().
| URI::Authority::HostKind Botan::URI::Authority::host_kind | ( | ) | const |
Which alternative of host() is held.
Definition at line 354 of file uri.cpp.
References BOTAN_ASSERT_UNREACHABLE.
| std::string Botan::URI::Authority::host_to_string | ( | ) | const |
The host as a string: DNS names and dotted-IPv4 literals are returned verbatim; IPv6 literals are returned without surrounding brackets. Lowercased for DNS / IPv4; the IPv6 form is whatever IPv6Address::to_string produces.
Definition at line 350 of file uri.cpp.
| std::strong_ordering Botan::URI::Authority::operator<=> | ( | const Authority & | other | ) | const |
Order two authorities
| other | the authority to compare against |
Definition at line 146 of file uri.cpp.
| bool Botan::URI::Authority::operator== | ( | const Authority & | other | ) | const |
|
inline |
The original input that was parsed
Definition at line 79 of file uri.h.
Referenced by from_string().
|
inline |
Port if present; nullopt otherwise.
Definition at line 74 of file uri.h.
Referenced by from_string().
|
inline |
The userinfo component, preserved verbatim (no case normalization or pct-decoding) and compared verbatim for identity. nullopt if no "@" was present; present-but-empty (e.g. "https://@example.com/") is distinguished from absent.
Definition at line 87 of file uri.h.
Referenced by from_string().