diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2024-03-06 18:34:34 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2024-03-08 14:18:43 +0100 |
commit | 3212e1e7895398c9c26b4243e8a5e3c490f9da5d (patch) | |
tree | 537b278bc817e7fff6b9761a55c92328dae1c60f /src/other_tools/utils/curl_url_handle.hpp | |
parent | ef15067da1e1615029d1a7ef835bb5278bc81c8d (diff) | |
download | justbuild-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.hpp | 5 |
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! |