Parsed URL components.
More...
#include <url.hpp>
|
| static std::optional< Url > | parse (std::string_view text) |
| | Parse a URL string.
|
| static bool | is_valid (std::string_view text) |
| | True if text parses as a URL with at least a scheme.
|
Parsed URL components.
All fields default to empty / absent. port is 0 when absent, which is also "scheme default".
◆ default_port()
| uint16_t pulp::runtime::Url::default_port |
( |
| ) |
const |
Default port for the scheme — e.g.
http=80, https=443, ftp=21, ws=80, wss=443. Returns 0 for unknown schemes.
◆ effective_port()
| uint16_t pulp::runtime::Url::effective_port |
( |
| ) |
const |
|
inline |
◆ empty()
| bool pulp::runtime::Url::empty |
( |
| ) |
const |
|
inline |
True when all components are empty / default.
◆ is_valid()
| bool pulp::runtime::Url::is_valid |
( |
std::string_view | text | ) |
|
|
inlinestatic |
True if text parses as a URL with at least a scheme.
◆ parse()
| std::optional< Url > pulp::runtime::Url::parse |
( |
std::string_view | text | ) |
|
|
static |
Parse a URL string.
Returns std::nullopt on a structurally invalid input (missing scheme or unterminated bracketed IPv6 host). Empty optional fields are normal and not an error.
◆ to_string()
| std::string pulp::runtime::Url::to_string |
( |
| ) |
const |
Serialize back to text form.
Includes user/password only when present. Brackets IPv6 hosts.
◆ fragment
| std::string pulp::runtime::Url::fragment |
◆ host
| std::string pulp::runtime::Url::host |
◆ password
| std::string pulp::runtime::Url::password |
◆ path
| std::string pulp::runtime::Url::path |
◆ port
| uint16_t pulp::runtime::Url::port = 0 |
◆ query
| std::string pulp::runtime::Url::query |
◆ scheme
| std::string pulp::runtime::Url::scheme |
◆ user
| std::string pulp::runtime::Url::user |
The documentation for this struct was generated from the following file:
- /home/runner/work/pulp/pulp/core/runtime/include/pulp/runtime/url.hpp