Ada 3.2.1
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
parser.h
Go to the documentation of this file.
1
5#ifndef ADA_PARSER_H
6#define ADA_PARSER_H
7
8#include <string_view>
9#include <variant>
10
11#include "ada/expected.h"
12
13#if ADA_INCLUDE_URL_PATTERN
16#endif // ADA_INCLUDE_URL_PATTERN
17
21namespace ada {
22struct url_aggregator;
23struct url;
24#if ADA_INCLUDE_URL_PATTERN
25template <url_pattern_regex::regex_concept regex_provider>
26class url_pattern;
28#endif // ADA_INCLUDE_URL_PATTERN
29enum class errors : uint8_t;
30} // namespace ada
31
36namespace ada::parser {
43template <typename result_type = url_aggregator>
44result_type parse_url(std::string_view user_input,
45 const result_type* base_url = nullptr);
46
48 std::string_view user_input, const url_aggregator* base_url);
49extern template url parse_url<url>(std::string_view user_input,
50 const url* base_url);
51
52template <typename result_type = url_aggregator, bool store_values = true>
53result_type parse_url_impl(std::string_view user_input,
54 const result_type* base_url = nullptr);
55
57 std::string_view user_input, const url_aggregator* base_url);
58extern template url parse_url_impl<url>(std::string_view user_input,
59 const url* base_url);
60
61#if ADA_INCLUDE_URL_PATTERN
62template <url_pattern_regex::regex_concept regex_provider>
63tl::expected<url_pattern<regex_provider>, errors> parse_url_pattern_impl(
64 std::variant<std::string_view, url_pattern_init>&& input,
65 const std::string_view* base_url, const url_pattern_options* options);
66#endif // ADA_INCLUDE_URL_PATTERN
67
68} // namespace ada::parser
69
70#endif // ADA_PARSER_H
Includes the definitions for supported parsers.
Definition parser-inl.h:18
template url parse_url< url >(std::string_view user_input, const url *base_url)
result_type parse_url(std::string_view user_input, const result_type *base_url=nullptr)
Definition parser.cpp:907
template url parse_url_impl< url >(std::string_view user_input, const url *base_url)
template url_aggregator parse_url_impl< url_aggregator >(std::string_view user_input, const url_aggregator *base_url)
template url_aggregator parse_url< url_aggregator >(std::string_view user_input, const url_aggregator *base_url)
result_type parse_url_impl(std::string_view user_input, const result_type *base_url=nullptr)
Definition parser.cpp:13
Definition ada_idna.h:13
errors
Definition errors.h:10
Lightweight URL struct.
Generic URL struct reliant on std::string instantiation.
Definition url.h:45
Declaration for the url_pattern_init implementation.