From 3212e1e7895398c9c26b4243e8a5e3c490f9da5d Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Wed, 6 Mar 2024 18:34:34 +0100 Subject: CurlURLHandle: Add GetHostname routine --- src/other_tools/utils/curl_url_handle.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/other_tools/utils/curl_url_handle.hpp') diff --git a/src/other_tools/utils/curl_url_handle.hpp b/src/other_tools/utils/curl_url_handle.hpp index 5648a535..4680cb34 100644 --- a/src/other_tools/utils/curl_url_handle.hpp +++ b/src/other_tools/utils/curl_url_handle.hpp @@ -165,6 +165,11 @@ class CurlURLHandle { std::string const& url, std::string const& hostname) noexcept -> std::optional; + /// \brief Gets the hostname from URL. + /// \returns The host name or std::nullopt if missing or on errors. + [[nodiscard]] static auto GetHostname(std::string const& url) noexcept + -> std::optional; + private: // IMPORTANT: the CurlContext must be initialized before any curl // object! -- cgit v1.2.3