diff options
author | antonovvk <antonovvk@yandex-team.ru> | 2022-02-10 16:47:51 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:51 +0300 |
commit | 37a63debdc21e372d99e1808cdd31aecf75018c3 (patch) | |
tree | fd84293fb9a1b16381dd6c1a5e14c78afacb8710 /library/cpp/string_utils/url/url.cpp | |
parent | 1fe621e70df847cc201ac942fe6d7804ea10508d (diff) | |
download | ydb-37a63debdc21e372d99e1808cdd31aecf75018c3.tar.gz |
Restoring authorship annotation for <antonovvk@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/string_utils/url/url.cpp')
-rw-r--r-- | library/cpp/string_utils/url/url.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp index 85f4ac5d69..bb75f02491 100644 --- a/library/cpp/string_utils/url/url.cpp +++ b/library/cpp/string_utils/url/url.cpp @@ -83,12 +83,12 @@ size_t GetHttpPrefixSize(const wchar16* url, bool ignorehttps) noexcept { size_t GetHttpPrefixSize(const TStringBuf url, bool ignorehttps) noexcept { return GetHttpPrefixSizeImpl<char>(url.data(), TKnownSize(url.size()), ignorehttps); -} - +} + size_t GetHttpPrefixSize(const TWtringBuf url, bool ignorehttps) noexcept { return GetHttpPrefixSizeImpl<wchar16>(url.data(), TKnownSize(url.size()), ignorehttps); -} - +} + TStringBuf CutHttpPrefix(const TStringBuf url, bool ignorehttps) noexcept { return CutHttpPrefixImpl(url, ignorehttps); } @@ -109,20 +109,20 @@ size_t GetSchemePrefixSize(const TStringBuf url) noexcept { const char* n = delim.brk(url.data(), url.end()); if (n + 2 >= url.end() || *n != ':' || n[1] != '/' || n[2] != '/') { - return 0; + return 0; } - return n + 3 - url.begin(); + return n + 3 - url.begin(); } TStringBuf GetSchemePrefix(const TStringBuf url) noexcept { - return url.Head(GetSchemePrefixSize(url)); -} - + return url.Head(GetSchemePrefixSize(url)); +} + TStringBuf CutSchemePrefix(const TStringBuf url) noexcept { - return url.Tail(GetSchemePrefixSize(url)); -} - + return url.Tail(GetSchemePrefixSize(url)); +} + template <bool KeepPort> static inline TStringBuf GetHostAndPortImpl(const TStringBuf url) { TStringBuf urlNoScheme = url; |