11template <
class result_type>
13 std::string_view input,
const result_type* base_url) {
23 const url* base_url =
nullptr);
25 std::string_view input,
const url_aggregator* base_url =
nullptr);
29 std::string tmp_buffer;
30 std::string_view internal_input;
31 if (unicode::has_tabs_or_newline(input)) {
33 helpers::remove_ascii_tab_or_newline(tmp_buffer);
34 internal_input = tmp_buffer;
36 internal_input = input;
39 if (internal_input.empty()) {
41 }
else if ((internal_input[0] ==
'/') || (internal_input[0] ==
'\\')) {
42 helpers::parse_prepared_path(internal_input.substr(1),
47 return "file://" + path;
50bool can_parse(std::string_view input,
const std::string_view* base_input) {
54 if (base_input !=
nullptr) {
56 *base_input,
nullptr);
60 base_pointer = &base_aggregator;
Includes all definitions for Ada.
Common definitions for cross-platform compiler support.
result_type parse_url_impl(std::string_view user_input, const result_type *base_url=nullptr)
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)
ada_warn_unused std::string to_string(encoding_type type)
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)
Definitions for the parser.
Declaration for the basic URL definitions.