6#ifndef UPA_URL_RESULT_H
7#define UPA_URL_RESULT_H
103class UPA_SO_VISIBLE
url_error :
public std::runtime_error {
110 :
std::runtime_error(what_arg)
128template<
typename T,
typename R =
bool>
133 constexpr result_value(R res) noexcept
135 constexpr result_value(R res, T val) noexcept
136 : value(val), result(res) {}
137 [[nodiscard]]
constexpr operator R() const noexcept {
validation_errc result() const noexcept
url_error(validation_errc res, const char *what_arg)
constexpr bool success(validation_errc res) noexcept
Check validation error code indicates success.
validation_errc
URL validation and other error codes.
@ invalid_base
Invalid base.
@ ipv6_invalid_compression
An IPv6 address begins with improper compression.
@ overflow
URL is too long.
@ ipv4_in_ipv6_too_many_pieces
An IPv6 address with IPv4 address syntax: the IPv6 address has more than 6 pieces.
@ host_invalid_code_point
An opaque host contains a forbidden host code point.
@ ipv6_multiple_compression
An IPv6 address is compressed in more than one spot.
@ file_url_not_windows_path
Not a Windows path in file URL.
@ scheme_invalid_code_point
@ ipv4_non_numeric_part
An IPv4 address part is not numeric.
@ special_scheme_missing_following_solidus
The input’s scheme is not followed by "//".
@ port_out_of_range
The input’s port is too big.
@ invalid_credentials
The input includes credentials.
@ file_url_cannot_have_host
POSIX path cannot have host.
@ ipv4_empty_part
An IPv4 address ends with a U+002E (.).
@ not_file_url
Not a file URL.
@ null_character
Path contains null character.
@ file_invalid_windows_drive_letter_host
A file: URL’s host is a Windows drive letter.
@ ipv6_invalid_code_point
@ ipv6_too_many_pieces
An IPv6 address contains more than 8 pieces.
@ file_url_unsupported_host
UNC path cannot have "." hostname.
@ ipv4_in_ipv6_too_few_parts
An IPv6 address with IPv4 address syntax: an IPv4 address contains too few parts.
@ ipv4_in_ipv6_invalid_code_point
@ file_url_invalid_unc
Invalid UNC path in file URL.
@ missing_scheme_non_relative_url
@ domain_invalid_code_point
Unused, use domain_to_ascii instead.
@ ipv6_too_few_pieces
An uncompressed IPv6 address contains fewer than 8 pieces.
@ host_missing
The input has a special scheme, but does not contain a host.
@ file_unsupported_path
Unsupported file path (e.g. non-absolute).
@ ipv4_too_many_parts
An IPv4 address does not consist of exactly 4 parts.
@ invalid_reverse_solidus
The URL has a special scheme and it uses U+005C () instead of U+002F (/).
@ domain_to_ascii
Unicode ToASCII records an error or returns the empty string.
@ ipv4_non_decimal_part
The IPv4 address contains numbers expressed using hexadecimal or octal digits.
@ file_empty_path
Path cannot be empty.
@ ipv4_in_ipv6_out_of_range_part
An IPv6 address with IPv4 address syntax: an IPv4 part exceeds 255.
@ ipv6_unclosed
An IPv6 address is missing the closing U+005D (]).
@ file_invalid_windows_drive_letter
@ port_invalid
The input’s port is invalid.
@ ipv4_out_of_range_part
An IPv4 address part exceeds 255.
@ invalid_url_unit
A code point is found that is not a URL unit.
@ ignored
Setter ignored the value (internal).
bool domain_to_unicode(std::basic_string< CharT > &output, const StrT &input, bool be_strict=false, bool is_input_ascii=false)
Implements the domain to Unicode algorithm.