Ada 3.3.0
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
15
19namespace ada {
20struct url_aggregator;
21struct url;
22#if ADA_INCLUDE_URL_PATTERN
23template <url_pattern_regex::regex_concept regex_provider>
24class url_pattern;
25struct url_pattern_options;
26#endif // ADA_INCLUDE_URL_PATTERN
27enum class errors : uint8_t;
28} // namespace ada
29
34namespace ada::parser {
41template <typename result_type = url_aggregator>
42result_type parse_url(std::string_view user_input,
43 const result_type* base_url = nullptr);
44
46 std::string_view user_input, const url_aggregator* base_url);
47extern template url parse_url<url>(std::string_view user_input,
48 const url* base_url);
49
50template <typename result_type = url_aggregator, bool store_values = true>
51result_type parse_url_impl(std::string_view user_input,
52 const result_type* base_url = nullptr);
53
55 std::string_view user_input, const url_aggregator* base_url);
56extern template url parse_url_impl<url>(std::string_view user_input,
57 const url* base_url);
58
59#if ADA_INCLUDE_URL_PATTERN
60template <url_pattern_regex::regex_concept regex_provider>
61tl::expected<url_pattern<regex_provider>, errors> parse_url_pattern_impl(
62 std::variant<std::string_view, url_pattern_init>&& input,
63 const std::string_view* base_url, const url_pattern_options* options);
64#endif // ADA_INCLUDE_URL_PATTERN
65
66} // namespace ada::parser
67
68#endif // ADA_PARSER_H
Includes the definitions for supported parsers.
Definition parser-inl.h:16
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:917
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:14
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.