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

Lightweight URL struct. More...

#include <url_aggregator.h>

Inheritance diagram for ada::url_aggregator:
ada::url_base ada::url_base

Public Member Functions

 url_aggregator ()=default
 
 url_aggregator (const url_aggregator &u)=default
 
 url_aggregator (url_aggregator &&u) noexcept=default
 
url_aggregatoroperator= (url_aggregator &&u) noexcept=default
 
url_aggregatoroperator= (const url_aggregator &u)=default
 
 ~url_aggregator () override=default
 
bool set_href (std::string_view input)
 
bool set_host (std::string_view input)
 
bool set_hostname (std::string_view input)
 
bool set_protocol (std::string_view input)
 
bool set_username (std::string_view input)
 
bool set_password (std::string_view input)
 
bool set_port (std::string_view input)
 
bool set_pathname (std::string_view input)
 
void set_search (std::string_view input)
 
void set_hash (std::string_view input)
 
bool has_valid_domain () const noexcept override
 
std::string get_origin () const noexcept override
 
std::string_view get_href () const noexcept ada_lifetime_bound
 
std::string_view get_username () const noexcept ada_lifetime_bound
 
std::string_view get_password () const noexcept ada_lifetime_bound
 
std::string_view get_port () const noexcept ada_lifetime_bound
 
std::string_view get_hash () const noexcept ada_lifetime_bound
 
std::string_view get_host () const noexcept ada_lifetime_bound
 
std::string_view get_hostname () const noexcept ada_lifetime_bound
 
std::string_view get_pathname () const noexcept ada_lifetime_bound
 
ada_really_inline uint32_t get_pathname_length () const noexcept
 
std::string_view get_search () const noexcept ada_lifetime_bound
 
std::string_view get_protocol () const noexcept ada_lifetime_bound
 
ada_really_inline bool has_credentials () const noexcept
 
ada_really_inline const ada::url_componentsget_components () const noexcept
 
std::string to_string () const override
 
std::string to_diagram () const
 
bool validate () const noexcept
 
bool has_empty_hostname () const noexcept
 
bool has_hostname () const noexcept
 
bool has_non_empty_username () const noexcept
 
bool has_non_empty_password () const noexcept
 
bool has_port () const noexcept
 
bool has_password () const noexcept
 
bool has_hash () const noexcept override
 
bool has_search () const noexcept override
 
void clear_port ()
 
void clear_hash ()
 
void clear_search () override
 
 url_aggregator ()=default
 
 url_aggregator (const url_aggregator &u)=default
 
 url_aggregator (url_aggregator &&u) noexcept=default
 
url_aggregatoroperator= (url_aggregator &&u) noexcept=default
 
url_aggregatoroperator= (const url_aggregator &u)=default
 
 ~url_aggregator () override=default
 
bool set_href (std::string_view input)
 
bool set_host (std::string_view input)
 
bool set_hostname (std::string_view input)
 
bool set_protocol (std::string_view input)
 
bool set_username (std::string_view input)
 
bool set_password (std::string_view input)
 
bool set_port (std::string_view input)
 
bool set_pathname (std::string_view input)
 
void set_search (std::string_view input)
 
void set_hash (std::string_view input)
 
bool has_valid_domain () const noexcept override
 
std::string get_origin () const noexcept override
 
std::string_view get_href () const noexcept ada_lifetime_bound
 
std::string_view get_username () const noexcept ada_lifetime_bound
 
std::string_view get_password () const noexcept ada_lifetime_bound
 
std::string_view get_port () const noexcept ada_lifetime_bound
 
std::string_view get_hash () const noexcept ada_lifetime_bound
 
std::string_view get_host () const noexcept ada_lifetime_bound
 
std::string_view get_hostname () const noexcept ada_lifetime_bound
 
std::string_view get_pathname () const noexcept ada_lifetime_bound
 
ada_really_inline uint32_t get_pathname_length () const noexcept
 
std::string_view get_search () const noexcept ada_lifetime_bound
 
std::string_view get_protocol () const noexcept ada_lifetime_bound
 
ada_really_inline bool has_credentials () const noexcept
 
ada_really_inline const ada::url_componentsget_components () const noexcept
 
std::string to_string () const override
 
std::string to_diagram () const
 
bool validate () const noexcept
 
bool has_empty_hostname () const noexcept
 
bool has_hostname () const noexcept
 
bool has_non_empty_username () const noexcept
 
bool has_non_empty_password () const noexcept
 
bool has_port () const noexcept
 
bool has_password () const noexcept
 
bool has_hash () const noexcept override
 
bool has_search () const noexcept override
 
void clear_port ()
 
void clear_hash ()
 
void clear_search () override
 
- Public Member Functions inherited from ada::url_base
virtual ~url_base ()=default
 
ada_really_inline bool is_special () const noexcept
 
virtual ~url_base ()=default
 
ada_really_inline bool is_special () const noexcept
 

Friends

ada::url_aggregator ada::parser::parse_url (std::string_view, const ada::url_aggregator *)
 
void ada::helpers::strip_trailing_spaces_from_opaque_path (ada::url_aggregator &url) noexcept
 
ada::url_aggregator ada::parser::parse_url_impl (std::string_view, const ada::url_aggregator *)
 
ada::url_aggregator ada::parser::parse_url_impl (std::string_view, const ada::url_aggregator *)
 
ada::url_aggregator ada::parser::parse_url (std::string_view, const ada::url_aggregator *)
 
void ada::helpers::strip_trailing_spaces_from_opaque_path (ada::url_aggregator &url) noexcept
 
ada::url_aggregator ada::parser::parse_url_impl (std::string_view, const ada::url_aggregator *)
 
ada::url_aggregator ada::parser::parse_url_impl (std::string_view, const ada::url_aggregator *)
 

Additional Inherited Members

- Public Attributes inherited from ada::url_base
bool is_valid {true}
 
bool has_opaque_path {false}
 
url_host_type host_type = url_host_type::DEFAULT
 

Detailed Description

Lightweight URL struct.

The url_aggregator class aims to minimize temporary memory allocation while representing a parsed URL. Internally, it contains a single normalized URL (the href), and it makes available the components, mostly using std::string_view.

Definition at line 25 of file url_aggregator.h.

Constructor & Destructor Documentation

◆ url_aggregator() [1/6]

◆ url_aggregator() [2/6]

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

References url_aggregator().

◆ url_aggregator() [3/6]

ada::url_aggregator::url_aggregator ( url_aggregator && u)
defaultnoexcept

References url_aggregator().

◆ ~url_aggregator() [1/2]

◆ url_aggregator() [4/6]

ada::url_aggregator::url_aggregator ( )
default

◆ url_aggregator() [5/6]

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

References url_aggregator().

◆ url_aggregator() [6/6]

ada::url_aggregator::url_aggregator ( url_aggregator && u)
defaultnoexcept

References url_aggregator().

◆ ~url_aggregator() [2/2]

ada::url_aggregator::~url_aggregator ( )
overridedefault

Member Function Documentation

◆ clear_hash() [1/2]

void ada::url_aggregator::clear_hash ( )
inline

◆ clear_hash() [2/2]

void ada::url_aggregator::clear_hash ( )
inline

References clear_hash().

◆ clear_port() [1/2]

void ada::url_aggregator::clear_port ( )
inline

◆ clear_port() [2/2]

void ada::url_aggregator::clear_port ( )
inline

References clear_port().

◆ clear_search() [1/2]

void ada::url_aggregator::clear_search ( )
inlineoverridevirtual

◆ clear_search() [2/2]

void ada::url_aggregator::clear_search ( )
inlineoverridevirtual

Implements ada::url_base.

References clear_search().

◆ get_components() [1/2]

ada_really_inline const ada::url_components & ada::url_aggregator::get_components ( ) const
nodiscardnoexcept

Useful for implementing efficient serialization for the URL.

https://user:pass@example.com:1234/foo/bar?baz#quux | | | | ^^^^| | | | | | | | | | ----- hash_start | | | | | |------— search_start | | | | | ----------------- pathname_start | | | |------------------— port | | | ----------------------- host_end | |-------------------------------— host_start | --------------------------------------- username_end ------------------------------------------— protocol_end

Inspired after servo/url

Returns
a constant reference to the underlying component attribute.
See also
https://github.com/servo/rust-url/blob/b65a45515c10713f6d212e6726719a020203cc98/url/src/quirks.rs#L31

Definition at line 731 of file url_aggregator-inl.h.

Referenced by get_components(), and ~url_aggregator().

◆ get_components() [2/2]

ada_really_inline const ada::url_components & ada::url_aggregator::get_components ( ) const
nodiscardnoexcept

Useful for implementing efficient serialization for the URL.

https://user:pass@example.com:1234/foo/bar?baz#quux | | | | ^^^^| | | | | | | | | | ----- hash_start | | | | | |------— search_start | | | | | ----------------- pathname_start | | | |------------------— port | | | ----------------------- host_end | |-------------------------------— host_start | --------------------------------------- username_end ------------------------------------------— protocol_end

Inspired after servo/url

Returns
a constant reference to the underlying component attribute.
See also
https://github.com/servo/rust-url/blob/b65a45515c10713f6d212e6726719a020203cc98/url/src/quirks.rs#L31

References ada_really_inline, and get_components().

◆ get_hash() [1/2]

std::string_view ada::url_aggregator::get_hash ( ) const
nodiscardnoexcept

Return U+0023 (#), followed by this's URL's fragment. This function does not allocate memory.

Returns
a lightweight std::string_view..
See also
https://url.spec.whatwg.org/#dom-url-hash

Definition at line 13863 of file ada.cpp.

References ada_lifetime_bound, ada_log, get_hash(), and ada::url_components::omitted.

Referenced by clear_hash(), get_hash(), to_string(), and ~url_aggregator().

◆ get_hash() [2/2]

std::string_view ada::url_aggregator::get_hash ( ) const
nodiscardnoexcept

Return U+0023 (#), followed by this's URL's fragment. This function does not allocate memory.

Returns
a lightweight std::string_view..
See also
https://url.spec.whatwg.org/#dom-url-hash

References ada_lifetime_bound, and get_hash().

◆ get_host() [1/2]

std::string_view ada::url_aggregator::get_host ( ) const
nodiscardnoexcept

Return url's host, serialized, followed by U+003A (:) and url's port, serialized. This function does not allocate memory. When there is no host, this function returns the empty view.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-host

Definition at line 13877 of file ada.cpp.

References ada_lifetime_bound, ada_log, and get_host().

Referenced by get_host(), get_origin(), to_string(), and ~url_aggregator().

◆ get_host() [2/2]

std::string_view ada::url_aggregator::get_host ( ) const
nodiscardnoexcept

Return url's host, serialized, followed by U+003A (:) and url's port, serialized. This function does not allocate memory. When there is no host, this function returns the empty view.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-host

References ada_lifetime_bound, and get_host().

◆ get_hostname() [1/2]

std::string_view ada::url_aggregator::get_hostname ( ) const
nodiscardnoexcept

Return this's URL's host, serialized. This function does not allocate memory. When there is no host, this function returns the empty view.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-hostname

Definition at line 13896 of file ada.cpp.

References ada_lifetime_bound, ada_log, and get_hostname().

Referenced by get_hostname(), has_valid_domain(), and ~url_aggregator().

◆ get_hostname() [2/2]

std::string_view ada::url_aggregator::get_hostname ( ) const
nodiscardnoexcept

Return this's URL's host, serialized. This function does not allocate memory. When there is no host, this function returns the empty view.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-hostname

References ada_lifetime_bound, and get_hostname().

◆ get_href() [1/2]

std::string_view ada::url_aggregator::get_href ( ) const
inlinenodiscardnoexcept

Return the normalized string. This function does not allocate memory. It is highly efficient.

Returns
a constant reference to the underlying normalized URL.
See also
https://url.spec.whatwg.org/#dom-url-href
https://url.spec.whatwg.org/#concept-url-serializer

Definition at line 847 of file url_aggregator-inl.h.

References ada_lifetime_bound, and ada_log.

Referenced by get_href(), and ~url_aggregator().

◆ get_href() [2/2]

std::string_view ada::url_aggregator::get_href ( ) const
inlinenodiscardnoexcept

Return the normalized string. This function does not allocate memory. It is highly efficient.

Returns
a constant reference to the underlying normalized URL.
See also
https://url.spec.whatwg.org/#dom-url-href
https://url.spec.whatwg.org/#concept-url-serializer

References ada_lifetime_bound, and get_href().

◆ get_origin() [1/2]

std::string ada::url_aggregator::get_origin ( ) const
nodiscardoverridevirtualnoexcept

The origin getter steps are to return the serialization of this's URL's origin. [HTML]

Returns
a newly allocated string.
See also
https://url.spec.whatwg.org/#concept-url-origin

Implements ada::url_base.

Definition at line 13806 of file ada.cpp.

References ada_log, ada::scheme::FILE, get_host(), get_origin(), get_pathname(), get_protocol(), ada::scheme::HTTP, ada::scheme::HTTPS, ada::url_base::is_special(), and ada::parse().

Referenced by get_origin(), and ~url_aggregator().

◆ get_origin() [2/2]

std::string ada::url_aggregator::get_origin ( ) const
nodiscardoverridevirtualnoexcept

The origin getter steps are to return the serialization of this's URL's origin. [HTML]

Returns
a newly allocated string.
See also
https://url.spec.whatwg.org/#concept-url-origin

Implements ada::url_base.

References get_origin().

◆ get_password() [1/2]

std::string_view ada::url_aggregator::get_password ( ) const
nodiscardnoexcept

The password getter steps are to return this's URL's password. This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-password

Definition at line 13843 of file ada.cpp.

References ada_lifetime_bound, ada_log, get_password(), and has_non_empty_password().

Referenced by get_password(), to_string(), and ~url_aggregator().

◆ get_password() [2/2]

std::string_view ada::url_aggregator::get_password ( ) const
nodiscardnoexcept

The password getter steps are to return this's URL's password. This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-password

References ada_lifetime_bound, and get_password().

◆ get_pathname() [1/2]

std::string_view ada::url_aggregator::get_pathname ( ) const
nodiscardnoexcept

The pathname getter steps are to return the result of URL path serializing this's URL. This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-pathname

Definition at line 13911 of file ada.cpp.

References ada_lifetime_bound, ada_log, get_pathname(), and ada::url_components::omitted.

Referenced by get_origin(), get_pathname(), set_pathname(), to_string(), and ~url_aggregator().

◆ get_pathname() [2/2]

std::string_view ada::url_aggregator::get_pathname ( ) const
nodiscardnoexcept

The pathname getter steps are to return the result of URL path serializing this's URL. This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-pathname

References ada_lifetime_bound, and get_pathname().

◆ get_pathname_length() [1/2]

ada_really_inline uint32_t ada::url_aggregator::get_pathname_length ( ) const
nodiscardnoexcept

Compute the pathname length in bytes without instantiating a view or a string.

Returns
size of the pathname in bytes
See also
https://url.spec.whatwg.org/#dom-url-pathname

Definition at line 156 of file url_aggregator-inl.h.

References ada_log, and ada::url_components::omitted.

Referenced by get_pathname_length(), and ~url_aggregator().

◆ get_pathname_length() [2/2]

ada_really_inline uint32_t ada::url_aggregator::get_pathname_length ( ) const
nodiscardnoexcept

Compute the pathname length in bytes without instantiating a view or a string.

Returns
size of the pathname in bytes
See also
https://url.spec.whatwg.org/#dom-url-pathname

References ada_really_inline, and get_pathname_length().

◆ get_port() [1/2]

std::string_view ada::url_aggregator::get_port ( ) const
nodiscardnoexcept

Return this's URL's port, serialized. This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-port

Definition at line 13853 of file ada.cpp.

References ada_lifetime_bound, ada_log, get_port(), and ada::url_components::omitted.

Referenced by get_port(), and ~url_aggregator().

◆ get_port() [2/2]

std::string_view ada::url_aggregator::get_port ( ) const
nodiscardnoexcept

Return this's URL's port, serialized. This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-port

References ada_lifetime_bound, and get_port().

◆ get_protocol() [1/2]

std::string_view ada::url_aggregator::get_protocol ( ) const
nodiscardnoexcept

The protocol getter steps are to return this's URL's scheme, followed by U+003A (:). This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-protocol

Definition at line 13944 of file ada.cpp.

References ada_lifetime_bound, ada_log, and get_protocol().

Referenced by get_origin(), get_protocol(), to_string(), and ~url_aggregator().

◆ get_protocol() [2/2]

std::string_view ada::url_aggregator::get_protocol ( ) const
nodiscardnoexcept

The protocol getter steps are to return this's URL's scheme, followed by U+003A (:). This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-protocol

References ada_lifetime_bound, and get_protocol().

◆ get_search() [1/2]

std::string_view ada::url_aggregator::get_search ( ) const
nodiscardnoexcept

Return U+003F (?), followed by this's URL's query. This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-search

Definition at line 13926 of file ada.cpp.

References ada_lifetime_bound, ada_log, get_search(), and ada::url_components::omitted.

Referenced by clear_search(), get_search(), to_string(), and ~url_aggregator().

◆ get_search() [2/2]

std::string_view ada::url_aggregator::get_search ( ) const
nodiscardnoexcept

Return U+003F (?), followed by this's URL's query. This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-search

References ada_lifetime_bound, and get_search().

◆ get_username() [1/2]

std::string_view ada::url_aggregator::get_username ( ) const
nodiscardnoexcept

The username getter steps are to return this's URL's username. This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-username

Definition at line 13833 of file ada.cpp.

References ada_lifetime_bound, ada_log, get_username(), and has_non_empty_username().

Referenced by get_username(), to_string(), and ~url_aggregator().

◆ get_username() [2/2]

std::string_view ada::url_aggregator::get_username ( ) const
nodiscardnoexcept

The username getter steps are to return this's URL's username. This function does not allocate memory.

Returns
a lightweight std::string_view.
See also
https://url.spec.whatwg.org/#dom-url-username

References ada_lifetime_bound, and get_username().

◆ has_credentials() [1/2]

ada_really_inline bool ada::url_aggregator::has_credentials ( ) const
nodiscardnoexcept

A URL includes credentials if its username or password is not the empty string.

Definition at line 719 of file url_aggregator-inl.h.

References ada_log, ada_really_inline, has_non_empty_password(), and has_non_empty_username().

Referenced by has_credentials(), to_string(), and ~url_aggregator().

◆ has_credentials() [2/2]

ada_really_inline bool ada::url_aggregator::has_credentials ( ) const
nodiscardnoexcept

A URL includes credentials if its username or password is not the empty string.

References ada_really_inline, and has_credentials().

◆ has_empty_hostname() [1/2]

bool ada::url_aggregator::has_empty_hostname ( ) const
inlinenodiscardnoexcept
Returns
true if it has an host but it is the empty string

Definition at line 791 of file url_aggregator-inl.h.

References has_hostname().

Referenced by has_empty_hostname(), and ~url_aggregator().

◆ has_empty_hostname() [2/2]

bool ada::url_aggregator::has_empty_hostname ( ) const
inlinenodiscardnoexcept
Returns
true if it has an host but it is the empty string

References has_empty_hostname().

◆ has_hash() [1/2]

bool ada::url_aggregator::has_hash ( ) const
inlinenodiscardoverridevirtualnoexcept
Returns
true if the URL has a hash component

Implements ada::url_base.

Definition at line 709 of file url_aggregator-inl.h.

References ada_log, and ada::url_components::omitted.

Referenced by has_hash(), and ~url_aggregator().

◆ has_hash() [2/2]

bool ada::url_aggregator::has_hash ( ) const
inlinenodiscardoverridevirtualnoexcept
Returns
true if the URL has a hash component

Implements ada::url_base.

References has_hash().

◆ has_hostname() [1/2]

bool ada::url_aggregator::has_hostname ( ) const
inlinenodiscardnoexcept
Returns
true if it has a host (included an empty host)

Definition at line 804 of file url_aggregator-inl.h.

Referenced by has_empty_hostname(), has_hostname(), has_port(), and ~url_aggregator().

◆ has_hostname() [2/2]

bool ada::url_aggregator::has_hostname ( ) const
inlinenodiscardnoexcept
Returns
true if it has a host (included an empty host)

References has_hostname().

◆ has_non_empty_password() [1/2]

bool ada::url_aggregator::has_non_empty_password ( ) const
inlinenodiscardnoexcept
Returns
true if the URL has a non-empty password

Definition at line 779 of file url_aggregator-inl.h.

References ada_log.

Referenced by get_password(), has_credentials(), has_non_empty_password(), and ~url_aggregator().

◆ has_non_empty_password() [2/2]

bool ada::url_aggregator::has_non_empty_password ( ) const
inlinenodiscardnoexcept
Returns
true if the URL has a non-empty password

References has_non_empty_password().

◆ has_non_empty_username() [1/2]

bool ada::url_aggregator::has_non_empty_username ( ) const
inlinenodiscardnoexcept
Returns
true if the URL has a non-empty username

Definition at line 774 of file url_aggregator-inl.h.

References ada_log.

Referenced by get_username(), has_credentials(), has_non_empty_username(), and ~url_aggregator().

◆ has_non_empty_username() [2/2]

bool ada::url_aggregator::has_non_empty_username ( ) const
inlinenodiscardnoexcept
Returns
true if the URL has a non-empty username

References has_non_empty_username().

◆ has_password() [1/2]

bool ada::url_aggregator::has_password ( ) const
inlinenodiscardnoexcept
Returns
true if the URL has a password

Definition at line 784 of file url_aggregator-inl.h.

References ada_log.

Referenced by has_password(), and ~url_aggregator().

◆ has_password() [2/2]

bool ada::url_aggregator::has_password ( ) const
inlinenodiscardnoexcept
Returns
true if the URL has a password

References has_password().

◆ has_port() [1/2]

bool ada::url_aggregator::has_port ( ) const
inlinenodiscardnoexcept
Returns
true if the URL has a (non default) port

Definition at line 808 of file url_aggregator-inl.h.

References ada_log, and has_hostname().

Referenced by has_port(), and ~url_aggregator().

◆ has_port() [2/2]

bool ada::url_aggregator::has_port ( ) const
inlinenodiscardnoexcept
Returns
true if the URL has a (non default) port

References has_port().

◆ has_search() [1/2]

bool ada::url_aggregator::has_search ( ) const
inlinenodiscardoverridevirtualnoexcept
Returns
true if the URL has a search component

Implements ada::url_base.

Definition at line 714 of file url_aggregator-inl.h.

References ada_log, and ada::url_components::omitted.

Referenced by has_search(), and ~url_aggregator().

◆ has_search() [2/2]

bool ada::url_aggregator::has_search ( ) const
inlinenodiscardoverridevirtualnoexcept
Returns
true if the URL has a search component

Implements ada::url_base.

References has_search().

◆ has_valid_domain() [1/2]

bool ada::url_aggregator::has_valid_domain ( ) const
nodiscardoverridevirtualnoexcept

Returns true if this URL has a valid domain as per RFC 1034 and corresponding specifications. Among other things, it requires that the domain string has fewer than 255 octets.

Implements ada::url_base.

Definition at line 14043 of file ada.cpp.

References get_hostname().

◆ has_valid_domain() [2/2]

bool ada::url_aggregator::has_valid_domain ( ) const
nodiscardoverridevirtualnoexcept

Returns true if this URL has a valid domain as per RFC 1034 and corresponding specifications. Among other things, it requires that the domain string has fewer than 255 octets.

Implements ada::url_base.

◆ operator=() [1/4]

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

References url_aggregator().

◆ operator=() [2/4]

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

References url_aggregator().

◆ operator=() [3/4]

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

References url_aggregator().

◆ operator=() [4/4]

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

References url_aggregator().

◆ set_hash() [1/2]

void ada::url_aggregator::set_hash ( std::string_view input)

Definition at line 13574 of file ada.cpp.

References ADA_ASSERT_TRUE, ada_log, ada::url_components::omitted, set_hash(), and validate().

Referenced by set_hash().

◆ set_hash() [2/2]

void ada::url_aggregator::set_hash ( std::string_view input)

◆ set_host() [1/2]

bool ada::url_aggregator::set_host ( std::string_view input)

Definition at line 13792 of file ada.cpp.

References ADA_ASSERT_TRUE, ada_log, set_host(), and validate().

Referenced by set_host().

◆ set_host() [2/2]

bool ada::url_aggregator::set_host ( std::string_view input)

◆ set_hostname() [1/2]

bool ada::url_aggregator::set_hostname ( std::string_view input)

Definition at line 13799 of file ada.cpp.

References ADA_ASSERT_TRUE, ada_log, set_hostname(), and validate().

Referenced by set_hostname().

◆ set_hostname() [2/2]

bool ada::url_aggregator::set_hostname ( std::string_view input)

◆ set_href() [1/2]

bool ada::url_aggregator::set_href ( std::string_view input)

◆ set_href() [2/2]

bool ada::url_aggregator::set_href ( std::string_view input)

◆ set_password() [1/2]

bool ada::url_aggregator::set_password ( std::string_view input)

◆ set_password() [2/2]

bool ada::url_aggregator::set_password ( std::string_view input)

◆ set_pathname() [1/2]

bool ada::url_aggregator::set_pathname ( std::string_view input)

◆ set_pathname() [2/2]

bool ada::url_aggregator::set_pathname ( std::string_view input)

◆ set_port() [1/2]

bool ada::url_aggregator::set_port ( std::string_view input)

Definition at line 13459 of file ada.cpp.

References ADA_ASSERT_TRUE, ada_log, clear_port(), ada::url_base::is_valid, set_port(), and validate().

Referenced by set_port().

◆ set_port() [2/2]

bool ada::url_aggregator::set_port ( std::string_view input)

◆ set_protocol() [1/2]

bool ada::url_aggregator::set_protocol ( std::string_view input)

Definition at line 13392 of file ada.cpp.

References ADA_ASSERT_TRUE, ada_log, ada::checkers::is_alpha(), set_protocol(), and validate().

Referenced by set_protocol().

◆ set_protocol() [2/2]

bool ada::url_aggregator::set_protocol ( std::string_view input)

◆ set_search() [1/2]

void ada::url_aggregator::set_search ( std::string_view input)

◆ set_search() [2/2]

void ada::url_aggregator::set_search ( std::string_view input)

◆ set_username() [1/2]

bool ada::url_aggregator::set_username ( std::string_view input)

◆ set_username() [2/2]

bool ada::url_aggregator::set_username ( std::string_view input)

◆ to_diagram() [1/2]

std::string ada::url_aggregator::to_diagram ( ) const
nodiscard

Returns a string diagram of this URL.

Definition at line 14408 of file ada.cpp.

References ada::url_base::is_valid, and ada::url_components::omitted.

Referenced by clear_hash(), clear_search(), to_diagram(), validate(), and ~url_aggregator().

◆ to_diagram() [2/2]

std::string ada::url_aggregator::to_diagram ( ) const
nodiscard

Returns a string diagram of this URL.

References to_diagram().

◆ to_string() [1/2]

std::string ada::url_aggregator::to_string ( ) const
nodiscardoverridevirtual

◆ to_string() [2/2]

std::string ada::url_aggregator::to_string ( ) const
nodiscardoverridevirtual

Returns a string representation of this URL.

Implements ada::url_base.

References to_string().

◆ validate() [1/2]

bool ada::url_aggregator::validate ( ) const
nodiscardnoexcept

Verifies that the parsed URL could be valid. Useful for debugging purposes.

Returns
true if the URL is valid, otherwise return true of the offsets are possible.

https://user:pass@example.com:1234/foo/bar?baz#quux | | | | ^^^^| | | | | | | | | | ----- hash_start | | | | | |------— search_start | | | | | ----------------- pathname_start | | | |------------------— port | | | ----------------------- host_end | |-------------------------------— host_start | --------------------------------------- username_end ------------------------------------------— protocol_end

Definition at line 14565 of file ada.cpp.

References ada_log, ada::url_base::has_opaque_path, ada::url_base::is_valid, ada::url_components::omitted, and to_diagram().

Referenced by clear_hash(), clear_port(), clear_search(), set_hash(), set_host(), set_hostname(), set_password(), set_pathname(), set_port(), set_protocol(), set_search(), set_username(), validate(), and ~url_aggregator().

◆ validate() [2/2]

bool ada::url_aggregator::validate ( ) const
nodiscardnoexcept

Verifies that the parsed URL could be valid. Useful for debugging purposes.

Returns
true if the URL is valid, otherwise return true of the offsets are possible.

References validate().

Friends And Related Symbol Documentation

◆ ada::helpers::strip_trailing_spaces_from_opaque_path [1/2]

void ada::helpers::strip_trailing_spaces_from_opaque_path ( ada::url_aggregator & url)
friend

◆ ada::helpers::strip_trailing_spaces_from_opaque_path [2/2]

void ada::helpers::strip_trailing_spaces_from_opaque_path ( ada::url_aggregator & url)
friend

◆ ada::parser::parse_url [1/2]

◆ ada::parser::parse_url [2/2]

◆ ada::parser::parse_url_impl [1/4]

◆ ada::parser::parse_url_impl [2/4]

◆ ada::parser::parse_url_impl [3/4]

◆ ada::parser::parse_url_impl [4/4]


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