Ada 2.9.2
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.
27 uint32_t index = 0;
28
30 return false;
31 }
32 if (protocol_end < index) {
33 return false;
34 }
35 index = protocol_end;
36
38 return false;
39 }
40 if (username_end < index) {
41 return false;
42 }
43 index = username_end;
44
46 return false;
47 }
48 if (host_start < index) {
49 return false;
50 }
51 index = host_start;
52
54 if (port > 0xffff) {
55 return false;
56 }
57 uint32_t port_length = helpers::fast_digit_count(port) + 1;
58 if (index + port_length < index) {
59 return false;
60 }
61 index += port_length;
62 }
63
65 return false;
66 }
67 if (pathname_start < index) {
68 return false;
69 }
70 index = pathname_start;
71
73 if (search_start < index) {
74 return false;
75 }
76 index = search_start;
77 }
78
80 if (hash_start < index) {
81 return false;
82 }
83 }
84
85 return true;
86}
87
88} // namespace ada
89#endif
Definition ada_idna.h:13
static constexpr uint32_t omitted
constexpr bool check_offset_consistency() const noexcept
Declaration for the URL Components.