URL parsing utility using libcurl's URL API. More...
#include <url.hpp>
Classes | |
| struct | UrlComponents |
| Container for parsed URL components. More... | |
Static Public Member Functions | |
| static UrlComponents | parse (std::string const &url, std::optional< unsigned int > bitmask_url_flags=std::nullopt, std::optional< unsigned int > bitmask_component_flags=std::nullopt) |
| Parses the given URL according to RFC 3986 plus and extracts its components. More... | |
| static std::optional< std::string > | extract_component (CurlUrlHandle const &handle, CURLUPart part, std::optional< unsigned int > bitmask_component_flags=std::nullopt, std::optional< CURLUcode > allowed_err_code=std::nullopt) |
| Extract a specific component from a CurlUrlHandle. More... | |
| static std::optional< std::string > | extract_component (std::string const &url, CURLUPart part, std::optional< unsigned int > bitmask_url_flags=std::nullopt, std::optional< unsigned int > bitmask_component_flags=std::nullopt, std::optional< CURLUcode > allowed_err_code=std::nullopt) |
| Extract a specific component from a URL string. More... | |
URL parsing utility using libcurl's URL API.
This class provides static methods for parsing URLs into their constituent components (scheme, host, port, path, query, fragment).
Example:
|
static |
Extract a specific component from a CurlUrlHandle.
| handle | The CurlUrlHandle containing the parsed URL |
| part | The URL part to extract (e.g., CURLUPART_SCHEME) |
| bitmask_component_flags | Flags controlling extraction behavior |
| allowed_err_code | Optional error code to treat as valid (e.g., CURLUE_NO_SCHEME) |
| std::runtime_error | if extraction fails with an unexpected error |
|
static |
Extract a specific component from a URL string.
| url | The URL string from which to extract a component |
| part | The URL part to extract |
| bitmask_url_flags | Optional flags for URL parsing. |
| bitmask_component_flags | Flags controlling extraction behavior |
| allowed_err_code | Optional error code to treat as valid |
| std::runtime_error | if extraction fails with an unexpected error |
|
static |
Parses the given URL according to RFC 3986 plus and extracts its components.
| url | The URL string to parse |
| bitmask_url_flags | Optional flags for URL parsing. Common flags include:
|
| bitmask_component_flags | Optional flags for component extraction. Common flags include:
|
| std::runtime_error | if the URL cannot be parsed or if component extraction fails |
Example: