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

#include <url_pattern_init.h>

Public Member Functions

bool operator== (const url_pattern_init &) const
 

Static Public Member Functions

static tl::expected< url_pattern_init, errorsprocess (url_pattern_init init, std::string_view type, std::optional< std::string_view > protocol=std::nullopt, std::optional< std::string_view > username=std::nullopt, std::optional< std::string_view > password=std::nullopt, std::optional< std::string_view > hostname=std::nullopt, std::optional< std::string_view > port=std::nullopt, std::optional< std::string_view > pathname=std::nullopt, std::optional< std::string_view > search=std::nullopt, std::optional< std::string_view > hash=std::nullopt)
 
static tl::expected< std::string, errorsprocess_protocol (std::string_view value, std::string_view type)
 
static tl::expected< std::string, errorsprocess_username (std::string_view value, std::string_view type)
 
static tl::expected< std::string, errorsprocess_password (std::string_view value, std::string_view type)
 
static tl::expected< std::string, errorsprocess_hostname (std::string_view value, std::string_view type)
 
static tl::expected< std::string, errorsprocess_port (std::string_view port, std::string_view protocol, std::string_view type)
 
static tl::expected< std::string, errorsprocess_pathname (std::string_view value, std::string_view protocol, std::string_view type)
 
static tl::expected< std::string, errorsprocess_search (std::string_view value, std::string_view type)
 
static tl::expected< std::string, errorsprocess_hash (std::string_view value, std::string_view type)
 

Public Attributes

std::optional< std::string > protocol {}
 
std::optional< std::string > username {}
 
std::optional< std::string > password {}
 
std::optional< std::string > hostname {}
 
std::optional< std::string > port {}
 
std::optional< std::string > pathname {}
 
std::optional< std::string > search {}
 
std::optional< std::string > hash {}
 
std::optional< std::string > base_url {}
 

Detailed Description

Definition at line 35 of file url_pattern_init.h.

Member Function Documentation

◆ operator==()

bool ada::url_pattern_init::operator== ( const url_pattern_init & other) const
inline

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

References hash, hostname, password, pathname, port, protocol, search, and username.

◆ process()

tl::expected< url_pattern_init, errors > ada::url_pattern_init::process ( url_pattern_init init,
std::string_view type,
std::optional< std::string_view > protocol = std::nullopt,
std::optional< std::string_view > username = std::nullopt,
std::optional< std::string_view > password = std::nullopt,
std::optional< std::string_view > hostname = std::nullopt,
std::optional< std::string_view > port = std::nullopt,
std::optional< std::string_view > pathname = std::nullopt,
std::optional< std::string_view > search = std::nullopt,
std::optional< std::string_view > hash = std::nullopt )
static

◆ process_hash()

tl::expected< std::string, errors > ada::url_pattern_init::process_hash ( std::string_view value,
std::string_view type )
static

Definition at line 349 of file url_pattern.cpp.

References ADA_ASSERT_TRUE, and ada::url_pattern_helpers::canonicalize_hash().

Referenced by process().

◆ process_hostname()

tl::expected< std::string, errors > ada::url_pattern_init::process_hostname ( std::string_view value,
std::string_view type )
static

Definition at line 293 of file url_pattern.cpp.

References ada::url_pattern_helpers::canonicalize_hostname().

Referenced by process().

◆ process_password()

tl::expected< std::string, errors > ada::url_pattern_init::process_password ( std::string_view value,
std::string_view type )
static

Definition at line 283 of file url_pattern.cpp.

References ada::url_pattern_helpers::canonicalize_password().

Referenced by process().

◆ process_pathname()

tl::expected< std::string, errors > ada::url_pattern_init::process_pathname ( std::string_view value,
std::string_view protocol,
std::string_view type )
static

◆ process_port()

tl::expected< std::string, errors > ada::url_pattern_init::process_port ( std::string_view port,
std::string_view protocol,
std::string_view type )
static

Definition at line 304 of file url_pattern.cpp.

References ada::url_pattern_helpers::canonicalize_port_with_protocol(), port, and protocol.

Referenced by process().

◆ process_protocol()

tl::expected< std::string, errors > ada::url_pattern_init::process_protocol ( std::string_view value,
std::string_view type )
static

Definition at line 257 of file url_pattern.cpp.

References ada::url_pattern_helpers::canonicalize_protocol().

Referenced by process().

◆ process_search()

tl::expected< std::string, errors > ada::url_pattern_init::process_search ( std::string_view value,
std::string_view type )
static

Definition at line 333 of file url_pattern.cpp.

References ADA_ASSERT_TRUE, and ada::url_pattern_helpers::canonicalize_search().

Referenced by process().

◆ process_username()

tl::expected< std::string, errors > ada::url_pattern_init::process_username ( std::string_view value,
std::string_view type )
static

Definition at line 273 of file url_pattern.cpp.

References ada::url_pattern_helpers::canonicalize_username().

Referenced by process().

Member Data Documentation

◆ base_url

std::optional<std::string> ada::url_pattern_init::base_url {}

Definition at line 104 of file url_pattern_init.h.

Referenced by ada::url_aggregator::parse_url_pattern_impl, and process().

◆ hash

std::optional<std::string> ada::url_pattern_init::hash {}

Definition at line 103 of file url_pattern_init.h.

Referenced by operator==(), and process().

◆ hostname

std::optional<std::string> ada::url_pattern_init::hostname {}

Definition at line 99 of file url_pattern_init.h.

Referenced by operator==(), and process().

◆ password

std::optional<std::string> ada::url_pattern_init::password {}

Definition at line 98 of file url_pattern_init.h.

Referenced by operator==(), and process().

◆ pathname

std::optional<std::string> ada::url_pattern_init::pathname {}

Definition at line 101 of file url_pattern_init.h.

Referenced by operator==(), and process().

◆ port

std::optional<std::string> ada::url_pattern_init::port {}

Definition at line 100 of file url_pattern_init.h.

Referenced by operator==(), process(), and process_port().

◆ protocol

std::optional<std::string> ada::url_pattern_init::protocol {}

◆ search

std::optional<std::string> ada::url_pattern_init::search {}

Definition at line 102 of file url_pattern_init.h.

Referenced by operator==(), and process().

◆ username

std::optional<std::string> ada::url_pattern_init::username {}

Definition at line 97 of file url_pattern_init.h.

Referenced by operator==(), and process().


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