diff options
author | Sergey Polovko <sergey@polovko.me> | 2022-02-10 16:47:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:03 +0300 |
commit | 2e714b5ebd40a1f4cc31c27f1ad6e49ca6d895f5 (patch) | |
tree | b83306b6e37edeea782e9eed673d89286c4fef35 /library/cpp/string_utils/url/url.h | |
parent | 3e0b762a82514bac89c1dd6ea7211e381d8aa248 (diff) | |
download | ydb-2e714b5ebd40a1f4cc31c27f1ad6e49ca6d895f5.tar.gz |
Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/string_utils/url/url.h')
-rw-r--r-- | library/cpp/string_utils/url/url.h | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/library/cpp/string_utils/url/url.h b/library/cpp/string_utils/url/url.h index 5e797e374a..84137ccc57 100644 --- a/library/cpp/string_utils/url/url.h +++ b/library/cpp/string_utils/url/url.h @@ -65,14 +65,14 @@ TString AddSchemePrefix(const TString& url); Y_PURE_FUNCTION TStringBuf GetHost(const TStringBuf url) noexcept; - + Y_PURE_FUNCTION TStringBuf GetHostAndPort(const TStringBuf url) noexcept; Y_PURE_FUNCTION TStringBuf GetSchemeHostAndPort(const TStringBuf url, bool trimHttp = true, bool trimDefaultPort = true) noexcept; -/** +/** * Splits URL to host and path * * @param[in] url any URL @@ -93,35 +93,35 @@ void SplitUrlToHostAndPath(const TStringBuf url, TString& host, TString& path); void SeparateUrlFromQueryAndFragment(const TStringBuf url, TStringBuf& sanitizedUrl, TStringBuf& query, TStringBuf& fragment); /** - * Extracts scheme, host and port from URL. - * - * Port will be parsed from URL with checks against ui16 overflow. If URL doesn't - * contain port it will be determined by one of the known schemes (currently - * https:// and http:// only). - * Given parameters will not be modified if URL has no appropriate components. - * - * @param[in] url any URL - * @param[out] scheme URL scheme - * @param[out] host host name - * @param[out] port parsed port number - * @return false if present port number cannot be parsed into ui16 - * true otherwise. - */ -bool TryGetSchemeHostAndPort(const TStringBuf url, TStringBuf& scheme, TStringBuf& host, ui16& port); - -/** - * Extracts scheme, host and port from URL. - * + * Extracts scheme, host and port from URL. + * + * Port will be parsed from URL with checks against ui16 overflow. If URL doesn't + * contain port it will be determined by one of the known schemes (currently + * https:// and http:// only). + * Given parameters will not be modified if URL has no appropriate components. + * + * @param[in] url any URL + * @param[out] scheme URL scheme + * @param[out] host host name + * @param[out] port parsed port number + * @return false if present port number cannot be parsed into ui16 + * true otherwise. + */ +bool TryGetSchemeHostAndPort(const TStringBuf url, TStringBuf& scheme, TStringBuf& host, ui16& port); + +/** + * Extracts scheme, host and port from URL. + * * This function perform the same actions as TryGetSchemeHostAndPort(), but in - * case of impossibility to parse port number throws yexception. - * - * @param[in] url any URL - * @param[out] scheme URL scheme - * @param[out] host host name - * @param[out] port parsed port number - * @throws yexception if present port number cannot be parsed into ui16. - */ -void GetSchemeHostAndPort(const TStringBuf url, TStringBuf& scheme, TStringBuf& host, ui16& port); + * case of impossibility to parse port number throws yexception. + * + * @param[in] url any URL + * @param[out] scheme URL scheme + * @param[out] host host name + * @param[out] port parsed port number + * @throws yexception if present port number cannot be parsed into ui16. + */ +void GetSchemeHostAndPort(const TStringBuf url, TStringBuf& scheme, TStringBuf& host, ui16& port); Y_PURE_FUNCTION TStringBuf GetPathAndQuery(const TStringBuf url, bool trimFragment = true) noexcept; |