Ada 3.1.0
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"
17
18namespace ada {
19
20template <class result_type = ada::url_aggregator>
21using result = tl::expected<result_type, ada::errors>;
22
32template <class result_type = ada::url_aggregator>
34 std::string_view input, const result_type* base_url = nullptr);
35
36extern template ada::result<url> parse<url>(std::string_view input,
37 const url* base_url);
39 std::string_view input, const url_aggregator* base_url);
40
47bool can_parse(std::string_view input,
48 const std::string_view* base_input = nullptr);
49
59template <url_pattern_regex::regex_concept regex_provider>
60ada_warn_unused tl::expected<url_pattern<regex_provider>, errors>
61parse_url_pattern(std::variant<std::string_view, url_pattern_init> input,
62 const std::string_view* base_url = nullptr,
63 const url_pattern_options* options = nullptr);
64
70std::string href_from_file(std::string_view path);
71} // namespace ada
72
73#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)
ada_warn_unused tl::expected< url_pattern< regex_provider >, errors > parse_url_pattern(std::variant< std::string_view, url_pattern_init > input, const std::string_view *base_url, const url_pattern_options *options)
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.