|
Ada 3.4.4
Fast spec-compliant URL parser
|
Abstract base class for URL representations. 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 =0 |
| virtual bool | has_valid_domain () const noexcept=0 |
| 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 |
Abstract base class for URL representations.
The url_base class provides the common interface and state shared by both ada::url and ada::url_aggregator. It contains basic URL attributes like validity status and scheme type, but delegates component storage and access to derived classes.
ada::url or ada::url_aggregator instead.Definition at line 49 of file url_base.h.
|
virtualdefault |
|
pure virtual |
Returns the URL's origin (scheme + host + port for special URLs).
Implemented in ada::url, and ada::url_aggregator.
Validates whether the hostname is a valid domain according to RFC 1034. Checks that the domain and its labels have valid lengths.
true if the domain is valid, false otherwise. Implemented in ada::url, and ada::url_aggregator.
References ada::parse().
|
constexprnoexcept |
Checks if the URL has a special scheme (http, https, ws, wss, ftp, file). Special schemes have specific parsing rules and default ports.
true if the scheme is special, false otherwise. Definition at line 19 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().
|
pure virtual |
Returns a JSON string representation of this URL for debugging.
Implemented in ada::url, and ada::url_aggregator.
Indicates whether the URL has an opaque path (non-hierarchical). Opaque paths occur in non-special URLs like mailto: or javascript:.
Definition at line 62 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 |
The type of the URL's host (domain, IPv4, or IPv6).
Definition at line 67 of file url_base.h.
Indicates whether the URL was successfully parsed. Set to false if parsing failed (e.g., invalid URL syntax).
Definition at line 56 of file url_base.h.
Referenced by 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().