Ada 3.0.1
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
ada::url_pattern< regex_provider > Class Template Reference

#include <url_pattern.h>

Public Member Functions

 url_pattern ()=default
 
result< std::optional< url_pattern_result > > exec (const url_pattern_input &input, const std::string_view *base_url=nullptr)
 
result< bool > test (const url_pattern_input &input, const std::string_view *base_url=nullptr)
 
result< std::optional< url_pattern_result > > match (const url_pattern_input &input, const std::string_view *base_url_string=nullptr)
 
std::string_view get_protocol () const ada_lifetime_bound
 
std::string_view get_username () const ada_lifetime_bound
 
std::string_view get_password () const ada_lifetime_bound
 
std::string_view get_hostname () const ada_lifetime_bound
 
std::string_view get_port () const ada_lifetime_bound
 
std::string_view get_pathname () const ada_lifetime_bound
 
std::string_view get_search () const ada_lifetime_bound
 
std::string_view get_hash () const ada_lifetime_bound
 
bool ignore_case () const
 
bool has_regexp_groups () const
 

Friends

template<url_pattern_regex::regex_concept P>
tl::expected< url_pattern< P >, errorsparser::parse_url_pattern_impl (std::variant< std::string_view, url_pattern_init > input, const std::string_view *base_url, const url_pattern_options *options)
 

Detailed Description

template<url_pattern_regex::regex_concept regex_provider>
class ada::url_pattern< regex_provider >

Definition at line 225 of file url_pattern.h.

Constructor & Destructor Documentation

◆ url_pattern()

Member Function Documentation

◆ exec()

template<url_pattern_regex::regex_concept regex_provider>
result< std::optional< url_pattern_result > > ada::url_pattern< regex_provider >::exec ( const url_pattern_input & input,
const std::string_view * base_url = nullptr )
See also
https://urlpattern.spec.whatwg.org/#dom-urlpattern-exec

Definition at line 195 of file url_pattern-inl.h.

References match().

Referenced by url_pattern().

◆ get_hash()

template<url_pattern_regex::regex_concept regex_provider>
std::string_view ada::url_pattern< regex_provider >::get_hash ( ) const
nodiscard

Definition at line 97 of file url_pattern-inl.h.

References ada_lifetime_bound.

Referenced by url_pattern().

◆ get_hostname()

template<url_pattern_regex::regex_concept regex_provider>
std::string_view ada::url_pattern< regex_provider >::get_hostname ( ) const
nodiscard

Definition at line 73 of file url_pattern-inl.h.

References ada_lifetime_bound.

Referenced by url_pattern().

◆ get_password()

template<url_pattern_regex::regex_concept regex_provider>
std::string_view ada::url_pattern< regex_provider >::get_password ( ) const
nodiscard

Definition at line 67 of file url_pattern-inl.h.

References ada_lifetime_bound.

Referenced by url_pattern().

◆ get_pathname()

template<url_pattern_regex::regex_concept regex_provider>
std::string_view ada::url_pattern< regex_provider >::get_pathname ( ) const
nodiscard

Definition at line 85 of file url_pattern-inl.h.

References ada_lifetime_bound.

Referenced by url_pattern().

◆ get_port()

template<url_pattern_regex::regex_concept regex_provider>
std::string_view ada::url_pattern< regex_provider >::get_port ( ) const
nodiscard

Definition at line 79 of file url_pattern-inl.h.

References ada_lifetime_bound.

Referenced by url_pattern().

◆ get_protocol()

template<url_pattern_regex::regex_concept regex_provider>
std::string_view ada::url_pattern< regex_provider >::get_protocol ( ) const
nodiscard

Definition at line 55 of file url_pattern-inl.h.

References ada_lifetime_bound.

Referenced by url_pattern().

◆ get_search()

template<url_pattern_regex::regex_concept regex_provider>
std::string_view ada::url_pattern< regex_provider >::get_search ( ) const
nodiscard

Definition at line 91 of file url_pattern-inl.h.

References ada_lifetime_bound.

Referenced by url_pattern().

◆ get_username()

template<url_pattern_regex::regex_concept regex_provider>
std::string_view ada::url_pattern< regex_provider >::get_username ( ) const
nodiscard

Definition at line 61 of file url_pattern-inl.h.

References ada_lifetime_bound.

Referenced by url_pattern().

◆ has_regexp_groups()

template<url_pattern_regex::regex_concept regex_provider>
bool ada::url_pattern< regex_provider >::has_regexp_groups ( ) const
nodiscard

Definition at line 107 of file url_pattern-inl.h.

Referenced by url_pattern().

◆ ignore_case()

template<url_pattern_regex::regex_concept regex_provider>
bool ada::url_pattern< regex_provider >::ignore_case ( ) const
nodiscard

Definition at line 103 of file url_pattern-inl.h.

Referenced by url_pattern().

◆ match()

template<url_pattern_regex::regex_concept regex_provider>
result< std::optional< url_pattern_result > > ada::url_pattern< regex_provider >::match ( const url_pattern_input & input,
const std::string_view * base_url_string = nullptr )

◆ test()

template<url_pattern_regex::regex_concept regex_provider>
result< bool > ada::url_pattern< regex_provider >::test ( const url_pattern_input & input,
const std::string_view * base_url = nullptr )
See also
https://urlpattern.spec.whatwg.org/#dom-urlpattern-test

Definition at line 203 of file url_pattern-inl.h.

References match(), and ada::type_error.

Referenced by url_pattern().

Friends And Related Symbol Documentation

◆ parser::parse_url_pattern_impl

template<url_pattern_regex::regex_concept regex_provider>
template<url_pattern_regex::regex_concept P>
tl::expected< url_pattern< P >, errors > parser::parse_url_pattern_impl ( std::variant< std::string_view, url_pattern_init > input,
const std::string_view * base_url,
const url_pattern_options * options )
friend

The documentation for this class was generated from the following files: