diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/string_utils/url | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/string_utils/url')
-rw-r--r-- | library/cpp/string_utils/url/url.cpp | 18 | ||||
-rw-r--r-- | library/cpp/string_utils/url/url.h | 4 | ||||
-rw-r--r-- | library/cpp/string_utils/url/url_ut.cpp | 4 | ||||
-rw-r--r-- | library/cpp/string_utils/url/ut/ya.make | 16 | ||||
-rw-r--r-- | library/cpp/string_utils/url/ya.make | 20 |
5 files changed, 31 insertions, 31 deletions
diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp index 85f4ac5d69..3bdf137598 100644 --- a/library/cpp/string_utils/url/url.cpp +++ b/library/cpp/string_utils/url/url.cpp @@ -1,11 +1,11 @@ #include "url.h" -#include <util/string/cast.h> -#include <util/string/util.h> -#include <util/string/cstriter.h> -#include <util/string/ascii.h> -#include <util/string/strip.h> - +#include <util/string/cast.h> +#include <util/string/util.h> +#include <util/string/cstriter.h> +#include <util/string/ascii.h> +#include <util/string/strip.h> + #include <util/charset/unidata.h> // for ToLower #include <util/system/defaults.h> #include <util/generic/algorithm.h> @@ -267,7 +267,7 @@ TStringBuf GetParentDomain(const TStringBuf host, size_t level) noexcept { size_t pos = host.size(); for (size_t i = 0; i < level; ++i) { pos = host.rfind('.', pos); - if (pos == TString::npos) + if (pos == TString::npos) return host; } return host.SubStr(pos + 1); @@ -310,7 +310,7 @@ TStringBuf CutMPrefix(const TStringBuf url) noexcept { return url; } -static inline bool IsSchemeChar(char c) noexcept { +static inline bool IsSchemeChar(char c) noexcept { return IsAsciiAlnum(c); //what about '+' ?.. } @@ -322,7 +322,7 @@ static bool HasPrefix(const TStringBuf url) noexcept { return AllOf(scheme, IsSchemeChar); } -TString AddSchemePrefix(const TString& url) { +TString AddSchemePrefix(const TString& url) { return AddSchemePrefix(url, TStringBuf("http")); } diff --git a/library/cpp/string_utils/url/url.h b/library/cpp/string_utils/url/url.h index 84137ccc57..f3ff2491f4 100644 --- a/library/cpp/string_utils/url/url.h +++ b/library/cpp/string_utils/url/url.h @@ -34,7 +34,7 @@ size_t GetHttpPrefixSize(const TStringBuf url, bool ignorehttps = false) noexcep Y_PURE_FUNCTION size_t GetHttpPrefixSize(const TWtringBuf url, bool ignorehttps = false) noexcept; -/** BEWARE of TStringBuf! You can not use operator ~ or c_str() like in TString +/** BEWARE of TStringBuf! You can not use operator ~ or c_str() like in TString !!!!!!!!!!!! */ Y_PURE_FUNCTION size_t GetSchemePrefixSize(const TStringBuf url) noexcept; @@ -61,7 +61,7 @@ TStringBuf CutSchemePrefix(const TStringBuf url) noexcept; TString AddSchemePrefix(const TString& url, const TStringBuf scheme); //! Same as `AddSchemePrefix(url, "http")`. -TString AddSchemePrefix(const TString& url); +TString AddSchemePrefix(const TString& url); Y_PURE_FUNCTION TStringBuf GetHost(const TStringBuf url) noexcept; diff --git a/library/cpp/string_utils/url/url_ut.cpp b/library/cpp/string_utils/url/url_ut.cpp index 1588013893..5c7c4ae6e3 100644 --- a/library/cpp/string_utils/url/url_ut.cpp +++ b/library/cpp/string_utils/url/url_ut.cpp @@ -1,7 +1,7 @@ #include "url.h" -#include <util/string/cast.h> - +#include <util/string/cast.h> + #include <library/cpp/testing/unittest/registar.h> Y_UNIT_TEST_SUITE(TUtilUrlTest) { diff --git a/library/cpp/string_utils/url/ut/ya.make b/library/cpp/string_utils/url/ut/ya.make index 0efa30e4d2..6e60701aaa 100644 --- a/library/cpp/string_utils/url/ut/ya.make +++ b/library/cpp/string_utils/url/ut/ya.make @@ -1,9 +1,9 @@ UNITTEST_FOR(library/cpp/string_utils/url) - -OWNER(g:util) - -SRCS( - url_ut.cpp -) - -END() + +OWNER(g:util) + +SRCS( + url_ut.cpp +) + +END() diff --git a/library/cpp/string_utils/url/ya.make b/library/cpp/string_utils/url/ya.make index b08d69ec83..179dbc062b 100644 --- a/library/cpp/string_utils/url/ya.make +++ b/library/cpp/string_utils/url/ya.make @@ -1,10 +1,10 @@ -LIBRARY() - -OWNER(g:util) - -SRCS( - url.cpp - url.h -) - -END() +LIBRARY() + +OWNER(g:util) + +SRCS( + url.cpp + url.h +) + +END() |