Ada 2.8.0
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
ada::parser Namespace Reference

Includes the definitions for supported parsers. More...

Functions

template<typename result_type = ada::url_aggregator>
result_type parse_url (std::string_view user_input, const result_type *base_url=nullptr)
 
template url_aggregator parse_url< url_aggregator > (std::string_view user_input, const url_aggregator *base_url)
 
template url parse_url< url > (std::string_view user_input, const url *base_url)
 

Detailed Description

Includes the definitions for supported parsers.

Function Documentation

◆ parse_url()

template<typename result_type = ada::url_aggregator>
result_type ada::parser::parse_url ( std::string_view user_input,
const result_type * base_url = nullptr )

Parses a url. The parameter user_input is the input to be parsed: it should be a valid UTF-8 string. The parameter base_url is an optional parameter that can be used to resolve relative URLs. If the base_url is provided, the user_input is resolved against the base_url.

We expect something of the sort... https://user:[email protected]:1234/foo/bar?baz#quux -----—^

We expect something of the sort... https://user:[email protected]:1234/foo/bar?baz#quux -----—^

Definition at line 14 of file parser.cpp.

References ADA_ASSERT_TRUE, ada::AUTHORITY, ada::checkers::begins_with(), ada::character_sets::C0_CONTROL_PERCENT_ENCODE, ada::scheme::FILE, ada::FILE, ada::FILE_HOST, ada::FILE_SLASH, ada::url::get_hostname(), ada::url::get_href(), ada::url::get_pathname(), ada::url::get_protocol(), ada::url_base::has_opaque_path, ada::HOST, ada::checkers::is_alpha(), ada::checkers::is_normalized_windows_drive_letter(), ada::url_base::is_special(), ada::url_base::is_valid, ada::checkers::is_windows_drive_letter(), ada::NO_SCHEME, ada::OPAQUE_PATH, ada::PATH, ada::PATH_OR_AUTHORITY, ada::PATH_START, ada::PORT, ada::QUERY, ada::character_sets::QUERY_PERCENT_ENCODE, ada::RELATIVE_SCHEME, ada::RELATIVE_SLASH, ada::SCHEME, ada::SCHEME_START, ada::url::set_host(), ada::url::set_hostname(), ada::SPECIAL_AUTHORITY_IGNORE_SLASHES, ada::SPECIAL_AUTHORITY_SLASHES, ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE, ada::SPECIAL_RELATIVE_OR_AUTHORITY, ada::to_string(), ada::unreachable(), and ada::character_sets::USERINFO_PERCENT_ENCODE.

Referenced by ada::parse().

◆ parse_url< url >()

template url ada::parser::parse_url< url > ( std::string_view user_input,
const url * base_url )
extern

◆ parse_url< url_aggregator >()

template url_aggregator ada::parser::parse_url< url_aggregator > ( std::string_view user_input,
const url_aggregator * base_url )
extern