|
Ada 4.1.1
Fast spec-compliant URL parser
|
Internal URL parsing implementation. More...
Namespaces | |
| namespace | anonymous_namespace{parser.cpp} |
Functions | |
| template<typename result_type = 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) |
| template<typename result_type = url_aggregator, bool store_values = true> | |
| result_type | parse_url_impl (std::string_view user_input, const result_type *base_url=nullptr) |
| template url_aggregator | parse_url_impl< url_aggregator, true > (std::string_view user_input, const url_aggregator *base_url) |
| template url_aggregator | parse_url_impl< url_aggregator, false > (std::string_view user_input, const url_aggregator *base_url) |
| template url | parse_url_impl< url, true > (std::string_view user_input, const url *base_url) |
| template<class result_type> | |
| ada_never_inline bool | finish_simple_absolute_with_port (std::string_view input, result_type &out, ada::scheme::type scheme_type, uint32_t protocol_end, size_t host_start, size_t host_end, size_t host_len, bool has_upper) |
| template<class result_type> | |
| ada_never_inline bool | try_parse_simple_absolute (std::string_view input, result_type &out) |
| template<class result_type> | |
| ada_never_inline bool | try_parse_simple_relative (std::string_view input, const result_type &base, result_type &out) |
| template bool | try_parse_simple_absolute< url > (std::string_view, url &) |
| template bool | try_parse_simple_absolute< url_aggregator > (std::string_view, url_aggregator &) |
| template bool | finish_simple_absolute_with_port< url > (std::string_view, url &, ada::scheme::type, uint32_t, size_t, size_t, size_t, bool) |
| template bool | finish_simple_absolute_with_port< url_aggregator > (std::string_view, url_aggregator &, ada::scheme::type, uint32_t, size_t, size_t, size_t, bool) |
| template bool | try_parse_simple_relative< url > (std::string_view, const url &, url &) |
| template bool | try_parse_simple_relative< url_aggregator > (std::string_view, const url_aggregator &, url_aggregator &) |
Internal URL parsing implementation.
Contains the core URL parsing algorithm as specified by the WHATWG URL Standard. These functions are used internally by ada::parse().
| ada_never_inline bool ada::parser::finish_simple_absolute_with_port | ( | std::string_view | input, |
| result_type & | out, | ||
| ada::scheme::type | scheme_type, | ||
| uint32_t | protocol_end, | ||
| size_t | host_start, | ||
| size_t | host_end, | ||
| size_t | host_len, | ||
| bool | has_upper ) |
Definition at line 1010 of file parser.cpp.
References ada_never_inline, ada::DEFAULT, ada::scheme::get_special_port(), ada::url_components::omitted, and ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE.
| template bool ada::parser::finish_simple_absolute_with_port< url > | ( | std::string_view | , |
| url & | , | ||
| ada::scheme::type | , | ||
| uint32_t | , | ||
| size_t | , | ||
| size_t | , | ||
| size_t | , | ||
| bool | ) |
| template bool ada::parser::finish_simple_absolute_with_port< url_aggregator > | ( | std::string_view | , |
| url_aggregator & | , | ||
| ada::scheme::type | , | ||
| uint32_t | , | ||
| size_t | , | ||
| size_t | , | ||
| size_t | , | ||
| bool | ) |
| result_type ada::parser::parse_url | ( | std::string_view | user_input, |
| const result_type * | base_url = nullptr ) |
Parses a URL string into a URL object.
| result_type | The type of URL object to create (url or url_aggregator). |
| user_input | The URL string to parse (must be valid UTF-8). |
| base_url | Optional base URL for resolving relative URLs. |
Definition at line 2889 of file parser.cpp.
References parse_url_impl().
|
extern |
|
extern |
| result_type ada::parser::parse_url_impl | ( | std::string_view | user_input, |
| const result_type * | base_url = nullptr ) |
We expect something of the sort... https://user:pass@example.com:1234/foo/bar?baz#quux -----—^
Definition at line 1841 of file parser.cpp.
References ADA_ASSERT_TRUE, ada::AUTHORITY, 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_href_size(), ada::get_max_input_length(), 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::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::can_parse(), ada::parse(), and parse_url().
|
extern |
|
extern |
|
extern |
| ada_never_inline bool ada::parser::try_parse_simple_absolute | ( | std::string_view | input, |
| result_type & | out ) |
Definition at line 1284 of file parser.cpp.
References ada_never_inline, ada::DEFAULT, ada::scheme::FTP, ada::scheme::HTTP, ada::scheme::HTTPS, ada::checkers::last_label_may_be_a_number(), ada::scheme::NOT_SPECIAL, ada::url_components::omitted, ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE, ada::scheme::WS, and ada::scheme::WSS.
| template bool ada::parser::try_parse_simple_absolute< url_aggregator > | ( | std::string_view | , |
| url_aggregator & | ) |
| ada_never_inline bool ada::parser::try_parse_simple_relative | ( | std::string_view | input, |
| const result_type & | base, | ||
| result_type & | out ) |
Definition at line 1659 of file parser.cpp.
References ada_never_inline, and ada::scheme::FILE.
| template bool ada::parser::try_parse_simple_relative< url > | ( | std::string_view | , |
| const url & | , | ||
| url & | ) |
| template bool ada::parser::try_parse_simple_relative< url_aggregator > | ( | std::string_view | , |
| const url_aggregator & | , | ||
| url_aggregator & | ) |