Upa URL C++ library
A WHATWG URL Standard implementation
Loading...
Searching...
No Matches
upa::urlpattern_init Struct Reference

URLPatternInit struct. More...

#include <upa/urlpattern.h>

Public Member Functions

constexpr bool operator== (const urlpattern_init &other) const
std::optional< std::string_view > get (std::string_view name) const
 Get value of member by name.
template<typename T, std::enable_if_t< std::is_assignable_v< std::string, T >, int > = 0>
void set (std::string_view name, T &&value)
 Set value of member by name.

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

URLPatternInit struct.

This struct represents the URLPatternInit dictionary as specified in URL Pattern specification.

Definition at line 159 of file urlpattern.h.

Member Function Documentation

◆ get()

std::optional< std::string_view > upa::urlpattern_init::get ( std::string_view name) const
inlinenodiscard

Get value of member by name.

Parameters
nameName of the member to get
Returns
Value of the member if found, std::nullopt otherwise

Definition at line 184 of file urlpattern.h.

◆ operator==()

bool upa::urlpattern_init::operator== ( const urlpattern_init & other) const
inlineconstexpr

Definition at line 173 of file urlpattern.h.

◆ set()

template<typename T, std::enable_if_t< std::is_assignable_v< std::string, T >, int > = 0>
void upa::urlpattern_init::set ( std::string_view name,
T && value )
inline

Set value of member by name.

Parameters
nameName of the member to set
valueValue to set, must be assignable to std::string

Definition at line 194 of file urlpattern.h.

Member Data Documentation

◆ base_url

std::optional<std::string> upa::urlpattern_init::base_url

Definition at line 168 of file urlpattern.h.

◆ hash

std::optional<std::string> upa::urlpattern_init::hash

Definition at line 167 of file urlpattern.h.

◆ hostname

std::optional<std::string> upa::urlpattern_init::hostname

Definition at line 163 of file urlpattern.h.

◆ password

std::optional<std::string> upa::urlpattern_init::password

Definition at line 162 of file urlpattern.h.

◆ pathname

std::optional<std::string> upa::urlpattern_init::pathname

Definition at line 165 of file urlpattern.h.

◆ port

std::optional<std::string> upa::urlpattern_init::port

Definition at line 164 of file urlpattern.h.

◆ protocol

std::optional<std::string> upa::urlpattern_init::protocol

Definition at line 160 of file urlpattern.h.

◆ search

std::optional<std::string> upa::urlpattern_init::search

Definition at line 166 of file urlpattern.h.

◆ username

std::optional<std::string> upa::urlpattern_init::username

Definition at line 161 of file urlpattern.h.


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