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

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 &)

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

◆ finish_simple_absolute_with_port()

template<class result_type>
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 )

◆ finish_simple_absolute_with_port< url >()

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  )

◆ finish_simple_absolute_with_port< url_aggregator >()

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  )

◆ 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_typeThe type of URL object to create (url or url_aggregator).
Parameters
user_inputThe URL string to parse (must be valid UTF-8).
base_urlOptional 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 2889 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()

◆ parse_url_impl< url, true >()

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

◆ parse_url_impl< url_aggregator, false >()

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

◆ parse_url_impl< url_aggregator, true >()

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

◆ try_parse_simple_absolute()

◆ try_parse_simple_absolute< url >()

template bool ada::parser::try_parse_simple_absolute< url > ( std::string_view ,
url &  )

◆ try_parse_simple_absolute< url_aggregator >()

template bool ada::parser::try_parse_simple_absolute< url_aggregator > ( std::string_view ,
url_aggregator &  )

◆ try_parse_simple_relative()

template<class result_type>
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.

◆ try_parse_simple_relative< url >()

template bool ada::parser::try_parse_simple_relative< url > ( std::string_view ,
const url & ,
url &  )

◆ try_parse_simple_relative< url_aggregator >()

template bool ada::parser::try_parse_simple_relative< url_aggregator > ( std::string_view ,
const url_aggregator & ,
url_aggregator &  )