Ada 4.1.1
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
10#include <cstdint>
11
12namespace ada {
13
14[[nodiscard]] constexpr bool url_components::check_offset_consistency()
15 const noexcept {
28 // These conditions can be made more strict.
30 return false;
31 }
32 uint32_t index = protocol_end;
33
35 return false;
36 }
37 if (username_end < index) {
38 return false;
39 }
40 index = username_end;
41
43 return false;
44 }
45 if (host_start < index) {
46 return false;
47 }
48 index = host_start;
49
51 if (port > 0xffff) {
52 return false;
53 }
54 uint32_t port_length = helpers::fast_digit_count(port) + 1;
55 if (index + port_length < index) {
56 return false;
57 }
58 index += port_length;
59 }
60
62 return false;
63 }
64 if (pathname_start < index) {
65 return false;
66 }
67 index = pathname_start;
68
70 if (search_start < index) {
71 return false;
72 }
73 index = search_start;
74 }
75
77 if (hash_start < index) {
78 return false;
79 }
80 }
81
82 return true;
83}
84
85} // namespace ada
86#endif
static constexpr uint32_t omitted
constexpr bool check_offset_consistency() const noexcept
Declaration for the URL Components.