Ada
3.4.3
Fast spec-compliant URL parser
Toggle main menu visibility
Loading...
Searching...
No Matches
parser.h
Go to the documentation of this file.
1
11
#ifndef ADA_PARSER_H
12
#define ADA_PARSER_H
13
14
#include <string_view>
15
#include <variant>
16
17
#include "ada/expected.h"
18
19
#include "
ada/url_pattern_regex.h
"
20
#include "
ada/url_pattern_init.h
"
21
23
namespace
ada
{
24
struct
url_aggregator
;
25
struct
url
;
26
#if ADA_INCLUDE_URL_PATTERN
27
template
<url_pattern_regex::regex_concept regex_prov
id
er>
28
class
url_pattern;
29
struct
url_pattern_options;
30
#endif
// ADA_INCLUDE_URL_PATTERN
31
enum class
errors
: uint8_t;
32
}
// namespace ada
33
41
namespace
ada::parser
{
55
template
<
typename
result_type = url_aggregator>
56
result_type
parse_url
(std::string_view user_input,
57
const
result_type* base_url =
nullptr
);
58
59
extern
template
url_aggregator
parse_url<url_aggregator>
(
60
std::string_view user_input,
const
url_aggregator
* base_url);
61
extern
template
url
parse_url<url>
(std::string_view user_input,
62
const
url
* base_url);
63
64
template
<
typename
result_type = url_aggregator,
bool
store_values = true>
65
result_type
parse_url_impl
(std::string_view user_input,
66
const
result_type* base_url =
nullptr
);
67
68
extern
template
url_aggregator
parse_url_impl<url_aggregator>
(
69
std::string_view user_input,
const
url_aggregator
* base_url);
70
extern
template
url
parse_url_impl<url>
(std::string_view user_input,
71
const
url
* base_url);
72
73
#if ADA_INCLUDE_URL_PATTERN
74
template
<url_pattern_regex::regex_concept regex_prov
id
er>
75
tl::expected<url_pattern<regex_provider>,
errors
> parse_url_pattern_impl(
76
std::variant<std::string_view, url_pattern_init>&& input,
77
const
std::string_view* base_url,
const
url_pattern_options* options);
78
#endif
// ADA_INCLUDE_URL_PATTERN
79
80
}
// namespace ada::parser
81
82
#endif
// ADA_PARSER_H
ada::parser
Internal URL parsing implementation.
Definition
parser-inl.h:16
ada::parser::parse_url
result_type parse_url(std::string_view user_input, const result_type *base_url=nullptr)
Definition
parser.cpp:917
ada::parser::parse_url_impl
result_type parse_url_impl(std::string_view user_input, const result_type *base_url=nullptr)
Definition
parser.cpp:14
ada
Definition
ada_idna.h:13
ada::errors
errors
Error codes for URL parsing operations.
Definition
errors.h:17
ada::url_aggregator
Memory-efficient URL representation using a single buffer.
Definition
url_aggregator.h:46
ada::url
Represents a parsed URL with individual string components.
Definition
url.h:62
url_pattern_init.h
Declaration for the url_pattern_init implementation.
url_pattern_regex.h