Loading...
Searching...
No Matches
ada::parser Namespace Reference

Internal URL parsing implementation. More...

## 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 > (std::string_view user_input, const url_aggregator *base_url)
template url | parse_url_impl< url > (std::string_view user_input, const url *base_url)
template url | parse_url_impl (std::string_view user_input, const url *base_url=nullptr)
template url_aggregator | parse_url_impl (std::string_view user_input, const url_aggregator *base_url=nullptr)

## Detailed Description

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().

## Function Documentation

## parse_url()

template<typename result_type = url_aggregator>

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.

Template Parameters

  result_type | The type of URL object to create (url or url_aggregator).

Parameters

  user_input | The URL string to parse (must be valid UTF-8).
  base_url | Optional base URL for resolving relative URLs.

Returns
  The parsed URL object. Check is_valid to determine if parsing succeeded.

See also
  https://url.spec.whatwg.org/#concept-basic-url-parser

Definition at line 935 of file parser.cpp.

References parse_url_impl().

## 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

## parse_url_impl() [1/3]

template<typename result_type = url_aggregator, bool store_values = true>

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 14 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_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().

## parse_url_impl() [2/3]

template url ada::parser::parse_url_impl | ( | std::string_view | user_input,
|  | const url * | base_url = nullptr )

## parse_url_impl() [3/3]

template url_aggregator ada::parser::parse_url_impl | ( | std::string_view | user_input,
|  | const url_aggregator * | base_url = nullptr )

## parse_url_impl< url >()

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

extern

## parse_url_impl< url_aggregator >()

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

extern