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

Namespaces

namespace  anonymous_namespace{url_pattern_helpers.cpp}
 

Classes

struct  constructor_string_parser
 
class  token
 
class  Tokenizer
 
class  url_pattern_parser
 

Enumerations

enum class  token_type : uint8_t {
  INVALID_CHAR , OPEN , CLOSE , REGEXP ,
  NAME , CHAR , ESCAPED_CHAR , OTHER_MODIFIER ,
  ASTERISK , END
}
 
enum class  token_policy { strict , lenient }
 

Functions

std::string to_string (token_type type)
 
template<url_pattern_encoding_callback F>
tl::expected< std::vector< url_pattern_part >, errorsparse_pattern_string (std::string_view input, url_pattern_compile_component_options &options, F &encoding_callback)
 
template<url_pattern_regex::regex_concept regex_provider>
bool protocol_component_matches_special_scheme (url_pattern_component< regex_provider > &component)
 
tl::expected< std::string, errorscanonicalize_protocol (std::string_view input)
 
tl::expected< std::string, errorscanonicalize_username (std::string_view input)
 
tl::expected< std::string, errorscanonicalize_password (std::string_view input)
 
tl::expected< std::string, errorscanonicalize_hostname (std::string_view input)
 
tl::expected< std::string, errorscanonicalize_ipv6_hostname (std::string_view input)
 
tl::expected< std::string, errorscanonicalize_port (std::string_view input)
 
tl::expected< std::string, errorscanonicalize_port_with_protocol (std::string_view input, std::string_view protocol)
 
tl::expected< std::string, errorscanonicalize_pathname (std::string_view input)
 
tl::expected< std::string, errorscanonicalize_opaque_pathname (std::string_view input)
 
tl::expected< std::string, errorscanonicalize_search (std::string_view input)
 
tl::expected< std::string, errorscanonicalize_hash (std::string_view input)
 
tl::expected< std::vector< token >, errorstokenize (std::string_view input, token_policy policy)
 
std::string process_base_url_string (std::string_view input, std::string_view type)
 
std::string escape_pattern_string (std::string_view input)
 
std::string escape_regexp_string (std::string_view input)
 
constexpr bool is_absolute_pathname (std::string_view input, std::string_view type) noexcept
 
std::string generate_pattern_string (std::vector< url_pattern_part > &part_list, url_pattern_compile_component_options &options)
 
std::tuple< std::string, std::vector< std::string > > generate_regular_expression_and_name_list (const std::vector< url_pattern_part > &part_list, url_pattern_compile_component_options options)
 
bool is_ipv6_address (std::string_view input) noexcept
 
std::string convert_modifier_to_string (url_pattern_part_modifier modifier)
 
std::string generate_segment_wildcard_regexp (url_pattern_compile_component_options options)
 

Enumeration Type Documentation

◆ token_policy

Enumerator
strict 
lenient 

Definition at line 39 of file url_pattern_helpers.h.

◆ token_type

enum class ada::url_pattern_helpers::token_type : uint8_t
strong
Enumerator
INVALID_CHAR 
OPEN 
CLOSE 
REGEXP 
NAME 
CHAR 
ESCAPED_CHAR 
OTHER_MODIFIER 
ASTERISK 
END 

Definition at line 23 of file url_pattern_helpers.h.

Function Documentation

◆ canonicalize_hash()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_hash ( std::string_view input)

◆ canonicalize_hostname()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_hostname ( std::string_view input)

◆ canonicalize_ipv6_hostname()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_ipv6_hostname ( std::string_view input)

Definition at line 280 of file url_pattern_helpers.cpp.

References ada::type_error.

Referenced by ada::url_aggregator::parse_url_pattern_impl.

◆ canonicalize_opaque_pathname()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_opaque_pathname ( std::string_view input)

◆ canonicalize_password()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_password ( std::string_view input)

◆ canonicalize_pathname()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_pathname ( std::string_view input)

◆ canonicalize_port()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_port ( std::string_view input)

◆ canonicalize_port_with_protocol()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_port_with_protocol ( std::string_view input,
std::string_view protocol )

◆ canonicalize_protocol()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_protocol ( std::string_view input)

◆ canonicalize_search()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_search ( std::string_view input)

◆ canonicalize_username()

tl::expected< std::string, errors > ada::url_pattern_helpers::canonicalize_username ( std::string_view input)

◆ convert_modifier_to_string()

std::string ada::url_pattern_helpers::convert_modifier_to_string ( url_pattern_part_modifier modifier)

◆ escape_pattern_string()

std::string ada::url_pattern_helpers::escape_pattern_string ( std::string_view input)

◆ escape_regexp_string()

std::string ada::url_pattern_helpers::escape_regexp_string ( std::string_view input)

◆ generate_pattern_string()

◆ generate_regular_expression_and_name_list()

std::tuple< std::string, std::vector< std::string > > ada::url_pattern_helpers::generate_regular_expression_and_name_list ( const std::vector< url_pattern_part > & part_list,
url_pattern_compile_component_options options )

◆ generate_segment_wildcard_regexp()

std::string ada::url_pattern_helpers::generate_segment_wildcard_regexp ( url_pattern_compile_component_options options)

◆ is_absolute_pathname()

bool ada::url_pattern_helpers::is_absolute_pathname ( std::string_view input,
std::string_view type )
constexprnoexcept

Definition at line 815 of file url_pattern_helpers.cpp.

Referenced by ada::url_pattern_init::process().

◆ is_ipv6_address()

bool ada::url_pattern_helpers::is_ipv6_address ( std::string_view input)
noexcept

Definition at line 146 of file url_pattern_helpers.cpp.

Referenced by ada::url_aggregator::parse_url_pattern_impl.

◆ parse_pattern_string()

template<url_pattern_encoding_callback F>
tl::expected< std::vector< url_pattern_part >, errors > ada::url_pattern_helpers::parse_pattern_string ( std::string_view input,
url_pattern_compile_component_options & options,
F & encoding_callback )

◆ process_base_url_string()

std::string ada::url_pattern_helpers::process_base_url_string ( std::string_view input,
std::string_view type )

Definition at line 805 of file url_pattern_helpers.cpp.

References escape_pattern_string().

Referenced by ada::url_pattern_init::process().

◆ protocol_component_matches_special_scheme()

template<url_pattern_regex::regex_concept regex_provider>
bool ada::url_pattern_helpers::protocol_component_matches_special_scheme ( url_pattern_component< regex_provider > & component)

◆ to_string()

◆ tokenize()

tl::expected< std::vector< token >, errors > ada::url_pattern_helpers::tokenize ( std::string_view input,
token_policy policy )