Ada 3.1.0
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
url_components-inl.h
Go to the documentation of this file.
1
5#ifndef ADA_URL_COMPONENTS_INL_H
6#define ADA_URL_COMPONENTS_INL_H
7
9
10namespace ada {
11
12[[nodiscard]] constexpr bool url_components::check_offset_consistency()
13 const noexcept {
26 // These conditions can be made more strict.
28 return false;
29 }
30 uint32_t index = protocol_end;
31
33 return false;
34 }
35 if (username_end < index) {
36 return false;
37 }
38 index = username_end;
39
41 return false;
42 }
43 if (host_start < index) {
44 return false;
45 }
46 index = host_start;
47
49 if (port > 0xffff) {
50 return false;
51 }
52 uint32_t port_length = helpers::fast_digit_count(port) + 1;
53 if (index + port_length < index) {
54 return false;
55 }
56 index += port_length;
57 }
58
60 return false;
61 }
62 if (pathname_start < index) {
63 return false;
64 }
65 index = pathname_start;
66
68 if (search_start < index) {
69 return false;
70 }
71 index = search_start;
72 }
73
75 if (hash_start < index) {
76 return false;
77 }
78 }
79
80 return true;
81}
82
83} // namespace ada
84#endif
Definition ada_idna.h:13
static constexpr uint32_t omitted
constexpr bool check_offset_consistency() const noexcept
Declaration for the URL Components.