20 if (
view.ends_with(
'.')) {
21 view.remove_suffix(1);
35 if (
last_dot != std::string_view::npos) {
46 if (
view.size() == 1) {
50 if (!
view.starts_with(
"0x")) {
54 if (
view.size() == 2) {
59 view.remove_prefix(2);
60 return std::ranges::all_of(
view, ada::unicode::is_lowercase_hex);
67 std::array<uint8_t, 256>
result{};
68 for (
size_t i = 0;
i < 256;
i++) {
69 if (
i <= 0x20 ||
i == 0x22 ||
i == 0x23 ||
i == 0x3c ||
i == 0x3e ||
70 i == 0x3f ||
i == 0x5e ||
i == 0x60 ||
i == 0x7b ||
i == 0x7d ||
73 }
else if (
i == 0x25) {
75 }
else if (
i == 0x2e) {
77 }
else if (
i == 0x5c) {
87 std::string_view
input)
noexcept {
95 for (;
i + 7 <
input.size();
i += 8) {
105 for (;
i <
input.size();
i++) {
112 std::string_view
input)
noexcept {
113 if (
input.back() ==
'.') {
114 if (
input.size() > 254)
return false;
115 }
else if (
input.size() > 253)
Definitions for URL specific checkers used within Ada.
Declarations for URL specific checkers used within Ada.
Cross-platform compiler macros and common definitions.
#define ada_really_inline
Includes the definitions for validation functions.
static constexpr std::array< uint8_t, 256 > path_signature_table
constexpr bool is_digit(char x) noexcept
tl::expected< result_type, ada::errors > result
ada_warn_unused ada::result< result_type > parse(std::string_view input, const result_type *base_url=nullptr)
Definitions for unicode operations.