Ada 3.1.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"
14
18namespace ada {
19struct url_aggregator;
20struct url;
21template <url_pattern_regex::regex_concept regex_provider>
22class url_pattern;
24enum class errors : uint8_t;
25} // namespace ada
26
31namespace ada::parser {
38template <typename result_type = url_aggregator>
39result_type parse_url(std::string_view user_input,
40 const result_type* base_url = nullptr);
41
43 std::string_view user_input, const url_aggregator* base_url);
44extern template url parse_url<url>(std::string_view user_input,
45 const url* base_url);
46
47template <typename result_type = url_aggregator, bool store_values = true>
48result_type parse_url_impl(std::string_view user_input,
49 const result_type* base_url = nullptr);
50
52 std::string_view user_input, const url_aggregator* base_url);
53extern template url parse_url_impl<url>(std::string_view user_input,
54 const url* base_url);
55
56template <url_pattern_regex::regex_concept regex_provider>
57tl::expected<url_pattern<regex_provider>, errors> parse_url_pattern_impl(
58 std::variant<std::string_view, url_pattern_init> input,
59 const std::string_view* base_url, const url_pattern_options* options);
60
61} // namespace ada::parser
62
63#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:907
tl::expected< url_pattern< regex_provider >, errors > parse_url_pattern_impl(std::variant< std::string_view, url_pattern_init > input, const std::string_view *base_url, const url_pattern_options *options)
Definition parser-inl.h:18
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.