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

#include <url_search_params.h>

Public Member Functions

 url_search_params ()=default
 
 url_search_params (const std::string_view input)
 
 url_search_params (const url_search_params &u)=default
 
 url_search_params (url_search_params &&u) noexcept=default
 
url_search_paramsoperator= (url_search_params &&u) noexcept=default
 
url_search_paramsoperator= (const url_search_params &u)=default
 
 ~url_search_params ()=default
 
size_t size () const noexcept
 
void append (std::string_view key, std::string_view value)
 
void remove (std::string_view key)
 
void remove (std::string_view key, std::string_view value)
 
std::optional< std::string_view > get (std::string_view key)
 
std::vector< std::string > get_all (std::string_view key)
 
bool has (std::string_view key) noexcept
 
bool has (std::string_view key, std::string_view value) noexcept
 
void set (std::string_view key, std::string_view value)
 
void sort ()
 
std::string to_string () const
 
url_search_params_keys_iter get_keys ()
 
url_search_params_values_iter get_values ()
 
url_search_params_entries_iter get_entries ()
 
auto begin () const
 
auto end () const
 
auto front () const
 
auto back () const
 
auto operator[] (size_t index) const
 

Friends

template<typename T , url_search_params_iter_type Type>
struct url_search_params_iter
 

Detailed Description

Constructor & Destructor Documentation

◆ url_search_params() [1/4]

ada::url_search_params::url_search_params ( )
default

◆ url_search_params() [2/4]

ada::url_search_params::url_search_params ( const std::string_view input)
inline

◆ url_search_params() [3/4]

ada::url_search_params::url_search_params ( const url_search_params & u)
default

◆ url_search_params() [4/4]

ada::url_search_params::url_search_params ( url_search_params && u)
defaultnoexcept

◆ ~url_search_params()

ada::url_search_params::~url_search_params ( )
default

Member Function Documentation

◆ append()

void ada::url_search_params::append ( std::string_view key,
std::string_view value )
inline

◆ back()

auto ada::url_search_params::back ( ) const
inline

Definition at line 130 of file url_search_params.h.

◆ begin()

auto ada::url_search_params::begin ( ) const
inline

C++ style conventional iterator support. const only because we do not really want the params to be modified via the iterator.

Definition at line 127 of file url_search_params.h.

◆ end()

auto ada::url_search_params::end ( ) const
inline

Definition at line 128 of file url_search_params.h.

◆ front()

auto ada::url_search_params::front ( ) const
inline

Definition at line 129 of file url_search_params.h.

◆ get()

std::optional< std::string_view > ada::url_search_params::get ( std::string_view key)
inline

◆ get_all()

std::vector< std::string > ada::url_search_params::get_all ( std::string_view key)
inline

◆ get_entries()

url_search_params_entries_iter ada::url_search_params::get_entries ( )
inline

Returns a simple JS-style iterator over all of the entries in this url_search_params. The entries are pairs of keys and corresponding values. The valid lifespan of the iterator is tied to the url_search_params. The iterator must be freed when you're done with it.

See also
https://url.spec.whatwg.org/#interface-urlsearchparams
https://url.spec.whatwg.org/#interface-urlsearchparams

Definition at line 186 of file url_search_params-inl.h.

◆ get_keys()

url_search_params_keys_iter ada::url_search_params::get_keys ( )
inline

Returns a simple JS-style iterator over all of the keys in this url_search_params. The keys in the iterator are not unique. The valid lifespan of the iterator is tied to the url_search_params. The iterator must be freed when you're done with it.

See also
https://url.spec.whatwg.org/#interface-urlsearchparams

Definition at line 172 of file url_search_params-inl.h.

◆ get_values()

url_search_params_values_iter ada::url_search_params::get_values ( )
inline

Returns a simple JS-style iterator over all of the values in this url_search_params. The valid lifespan of the iterator is tied to the url_search_params. The iterator must be freed when you're done with it.

See also
https://url.spec.whatwg.org/#interface-urlsearchparams
https://url.spec.whatwg.org/#interface-urlsearchparams

Definition at line 179 of file url_search_params-inl.h.

◆ has() [1/2]

bool ada::url_search_params::has ( std::string_view key)
inlinenoexcept

◆ has() [2/2]

bool ada::url_search_params::has ( std::string_view key,
std::string_view value )
inlinenoexcept

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

References ada::parse().

◆ operator=() [1/2]

url_search_params & ada::url_search_params::operator= ( const url_search_params & u)
default

◆ operator=() [2/2]

url_search_params & ada::url_search_params::operator= ( url_search_params && u)
defaultnoexcept

◆ operator[]()

auto ada::url_search_params::operator[] ( size_t index) const
inline

Definition at line 131 of file url_search_params.h.

◆ remove() [1/2]

void ada::url_search_params::remove ( std::string_view key)
inline

◆ remove() [2/2]

void ada::url_search_params::remove ( std::string_view key,
std::string_view value )
inline

Definition at line 155 of file url_search_params-inl.h.

References ada::parse().

◆ set()

void ada::url_search_params::set ( std::string_view key,
std::string_view value )
inline

◆ size()

size_t ada::url_search_params::size ( ) const
inlinenoexcept

Definition at line 70 of file url_search_params-inl.h.

◆ sort()

void ada::url_search_params::sort ( )
inline

◆ to_string()

std::string ada::url_search_params::to_string ( ) const
inline

Friends And Related Symbol Documentation

◆ url_search_params_iter


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