Ada 3.1.0
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
url_components.h
Go to the documentation of this file.
1
5#ifndef ADA_URL_COMPONENTS_H
6#define ADA_URL_COMPONENTS_H
7
8namespace ada {
9
19 constexpr static uint32_t omitted = uint32_t(-1);
20
21 url_components() = default;
22 url_components(const url_components &u) = default;
23 url_components(url_components &&u) noexcept = default;
24 url_components &operator=(url_components &&u) noexcept = default;
26 ~url_components() = default;
27
28 /*
29 * By using 32-bit integers, we implicitly assume that the URL string
30 * cannot exceed 4 GB.
31 *
32 * https://user:pass@example.com:1234/foo/bar?baz#quux
33 * | | | | ^^^^| | |
34 * | | | | | | | `----- hash_start
35 * | | | | | | `--------- search_start
36 * | | | | | `----------------- pathname_start
37 * | | | | `--------------------- port
38 * | | | `----------------------- host_end
39 * | | `---------------------------------- host_start
40 * | `--------------------------------------- username_end
41 * `--------------------------------------------- protocol_end
42 */
43 uint32_t protocol_end{0};
48 uint32_t username_end{0};
49 uint32_t host_start{0};
50 uint32_t host_end{0};
51 uint32_t port{omitted};
52 uint32_t pathname_start{0};
55
65 [[nodiscard]] constexpr bool check_offset_consistency() const noexcept;
66
70 [[nodiscard]] std::string to_string() const;
71
72}; // struct url_components
73} // namespace ada
74#endif
Definition ada_idna.h:13
ada_warn_unused std::string to_string(encoding_type type)
static constexpr uint32_t omitted
constexpr bool check_offset_consistency() const noexcept
url_components & operator=(url_components &&u) noexcept=default
~url_components()=default
url_components()=default
url_components(url_components &&u) noexcept=default
url_components(const url_components &u)=default
url_components & operator=(const url_components &u)=default