summaryrefslogtreecommitdiff
path: root/src/other_tools/utils/curl_url_handle.hpp
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2024-03-06 18:34:34 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2024-03-08 14:18:43 +0100
commit3212e1e7895398c9c26b4243e8a5e3c490f9da5d (patch)
tree537b278bc817e7fff6b9761a55c92328dae1c60f /src/other_tools/utils/curl_url_handle.hpp
parentef15067da1e1615029d1a7ef835bb5278bc81c8d (diff)
downloadjustbuild-3212e1e7895398c9c26b4243e8a5e3c490f9da5d.tar.gz
CurlURLHandle: Add GetHostname routine
Diffstat (limited to 'src/other_tools/utils/curl_url_handle.hpp')
-rw-r--r--src/other_tools/utils/curl_url_handle.hpp5
1 files changed, 5 insertions, 0 deletions
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<std::string>;
+ /// \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<std::string>;
+
private:
// IMPORTANT: the CurlContext must be initialized before any curl
// object!