Ada 3.2.1
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
implementation.h
Go to the documentation of this file.
1
6#ifndef ADA_IMPLEMENTATION_H
7#define ADA_IMPLEMENTATION_H
8
9#include <string>
10#include <string_view>
11#include <optional>
12
13#include "ada/url.h"
14#include "ada/common_defs.h"
15#include "ada/errors.h"
16
17#if ADA_INCLUDE_URL_PATTERN
19#endif // ADA_INCLUDE_URL_PATTERN
20
21namespace ada {
22
23template <class result_type = ada::url_aggregator>
24using result = tl::expected<result_type, ada::errors>;
25
35template <class result_type = ada::url_aggregator>
37 std::string_view input, const result_type* base_url = nullptr);
38
39extern template ada::result<url> parse<url>(std::string_view input,
40 const url* base_url);
42 std::string_view input, const url_aggregator* base_url);
43
50bool can_parse(std::string_view input,
51 const std::string_view* base_input = nullptr);
52
53#if ADA_INCLUDE_URL_PATTERN
63template <url_pattern_regex::regex_concept regex_provider>
64ada_warn_unused tl::expected<url_pattern<regex_provider>, errors>
65parse_url_pattern(std::variant<std::string_view, url_pattern_init>&& input,
66 const std::string_view* base_url = nullptr,
67 const url_pattern_options* options = nullptr);
68#endif // ADA_INCLUDE_URL_PATTERN
69
75std::string href_from_file(std::string_view path);
76} // namespace ada
77
78#endif // ADA_IMPLEMENTATION_H
Common definitions for cross-platform compiler support.
#define ada_warn_unused
Definition common_defs.h:85
Definitions for the errors.
Definition ada_idna.h:13
bool can_parse(std::string_view input, const std::string_view *base_input=nullptr)
template ada::result< url > parse< url >(std::string_view input, const url *base_url)
std::string href_from_file(std::string_view path)
errors
Definition errors.h:10
template ada::result< url_aggregator > parse< url_aggregator >(std::string_view input, const url_aggregator *base_url)
tl::expected< result_type, ada::errors > result
ada_warn_unused ada::result< result_type > parse(std::string_view input, const result_type *base_url=nullptr)
Lightweight URL struct.
Generic URL struct reliant on std::string instantiation.
Definition url.h:45
Declaration for the URL.
Declaration for the url_pattern_init implementation.