Ada 2.9.2
Fast spec-compliant URL parser
|
Base class of URL implementations. More...
#include <url_base.h>
Public Member Functions | |
virtual | ~url_base ()=default |
ada_really_inline constexpr bool | is_special () const noexcept |
virtual std::string | get_origin () const noexcept=0 |
virtual bool | has_valid_domain () const noexcept=0 |
virtual ada_really_inline size_t | parse_port (std::string_view view) noexcept |
virtual std::string | to_string () const =0 |
Public Attributes | |
bool | is_valid {true} |
bool | has_opaque_path {false} |
url_host_type | host_type = url_host_type::DEFAULT |
Base class of URL implementations.
A url_base contains a few attributes: is_valid, has_opaque_path and type. All non-trivial implementation details are in derived classes such as ada::url and ada::url_aggregator.
It is an abstract class that cannot be instantiated directly.
Definition at line 44 of file url_base.h.
|
virtualdefault |
|
nodiscardpure virtualnoexcept |
The origin getter steps are to return the serialization of this's URL's origin. [HTML]
Implemented in ada::url, and ada::url_aggregator.
|
nodiscardpure virtualnoexcept |
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.
Implemented in ada::url, and ada::url_aggregator.
|
nodiscardconstexprnoexcept |
A URL is special if its scheme is a special scheme. A URL is not special if its scheme is not a special scheme.
Definition at line 24 of file url_base-inl.h.
References ada::scheme::NOT_SPECIAL.
Referenced by ada::url::get_origin(), ada::url_aggregator::get_origin(), ada::url::get_protocol(), ada::parser::parse_url_impl(), ada::url::set_search(), and ada::url_aggregator::set_search().
|
inlinevirtualnoexcept |
Definition at line 117 of file url_base.h.
|
nodiscardpure virtual |
Returns a JSON string representation of this URL.
Implemented in ada::url, and ada::url_aggregator.
bool ada::url_base::has_opaque_path {false} |
A URL has an opaque path if its path is a string.
Definition at line 55 of file url_base.h.
Referenced by ada::url::get_components(), ada::url::get_href(), ada::parser::parse_url_impl(), ada::url::set_pathname(), ada::url_aggregator::set_pathname(), ada::url::to_string(), and ada::url_aggregator::validate().
url_host_type ada::url_base::host_type = url_host_type::DEFAULT |
URL hosts type
Definition at line 60 of file url_base.h.
bool ada::url_base::is_valid {true} |
Used for returning the validity from the result of the URL parser.
Definition at line 50 of file url_base.h.
Referenced by ada::can_parse(), ada::parser::parse_url_impl(), ada::url::set_port(), ada::url_aggregator::set_port(), ada::url_aggregator::to_diagram(), ada::url::to_string(), and ada::url_aggregator::validate().