diff options
author | manavrion <manavrion@yandex-team.ru> | 2022-02-10 16:49:16 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:16 +0300 |
commit | 29d0b2eeae154d04156e0698067c0c21a97ea61d (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp | |
parent | 109de9f4c31b6caaa736ce29a61fce05851e7c02 (diff) | |
download | ydb-29d0b2eeae154d04156e0698067c0c21a97ea61d.tar.gz |
Restoring authorship annotation for <manavrion@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/lwtrace/mon/analytics/util.h | 4 | ||||
-rw-r--r-- | library/cpp/lwtrace/mon/mon_lwtrace.cpp | 20 | ||||
-rw-r--r-- | library/cpp/string_utils/url/url.cpp | 30 | ||||
-rw-r--r-- | library/cpp/string_utils/url/url.h | 44 |
4 files changed, 49 insertions, 49 deletions
diff --git a/library/cpp/lwtrace/mon/analytics/util.h b/library/cpp/lwtrace/mon/analytics/util.h index 7eb0f0f67f..e07d06cc43 100644 --- a/library/cpp/lwtrace/mon/analytics/util.h +++ b/library/cpp/lwtrace/mon/analytics/util.h @@ -18,7 +18,7 @@ inline void ParseNameAndOpts(const TString& nameAndOpts, TString& name, THashSet name.clear(); opts.clear(); bool first = true; - auto vs = SplitString(nameAndOpts, "-"); + auto vs = SplitString(nameAndOpts, "-"); for (const auto& s : vs) { if (first) { name = s; @@ -31,7 +31,7 @@ inline void ParseNameAndOpts(const TString& nameAndOpts, TString& name, THashSet inline TString ParseName(const TString& nameAndOpts) { - auto vs = SplitString(nameAndOpts, "-"); + auto vs = SplitString(nameAndOpts, "-"); if (vs.empty()) { return TString(); } else { diff --git a/library/cpp/lwtrace/mon/mon_lwtrace.cpp b/library/cpp/lwtrace/mon/mon_lwtrace.cpp index 023655af3c..a61ee9ce22 100644 --- a/library/cpp/lwtrace/mon/mon_lwtrace.cpp +++ b/library/cpp/lwtrace/mon/mon_lwtrace.cpp @@ -352,7 +352,7 @@ private: void ParseQuery(const TString& s) { - auto parts = SplitString(s, "."); + auto parts = SplitString(s, "."); WWW_CHECK(parts.size() <= 3, "too many name specifiers"); ParseParamSelector(parts.back()); if (parts.size() >= 2) { @@ -575,12 +575,12 @@ struct TAdHocTraceConfig { bool ParseId(const TString& id) { if (IsAdHocId(id)) { - for (const TString& block : SplitString(id, "/")) { + for (const TString& block : SplitString(id, "/")) { if (block.empty()) { continue; } size_t cutPos = (block[0] == '.'? 1: 0); - TVector<TString> parts = SplitString(block.substr(cutPos), "."); + TVector<TString> parts = SplitString(block.substr(cutPos), "."); WWW_CHECK(parts.size() >= 2, "too few parts in adhoc trace id '%s' block '%s'", id.data(), block.data()); auto blockPb = Cfg.AddBlocks(); auto pdescPb = blockPb->MutableProbeDesc(); @@ -666,7 +666,7 @@ private: // NOTE: checks for longer action names should go first, your captain. if (a.substr(0, 3) == "lsr") { auto pb = action->MutableRunLogShuttleAction(); - for (const TString& opt : SplitString(a.substr(3), "-")) { + for (const TString& opt : SplitString(a.substr(3), "-")) { if (!opt.empty()) { switch (opt[0]) { case 'i': pb->SetIgnore(true); break; @@ -678,7 +678,7 @@ private: } } else if (a.substr(0, 3) == "lse") { auto pb = action->MutableEditLogShuttleAction(); - for (const TString& opt : SplitString(a.substr(3), "-")) { + for (const TString& opt : SplitString(a.substr(3), "-")) { if (!opt.empty()) { switch (opt[0]) { case 'i': pb->SetIgnore(true); break; @@ -690,7 +690,7 @@ private: action->MutableDropLogShuttleAction(); } else if (a.substr(0, 1) == "l") { auto pb = action->MutableLogAction(); - for (const TString& opt : SplitString(a.substr(1), "-")) { + for (const TString& opt : SplitString(a.substr(1), "-")) { if (!opt.empty()) { switch (opt[0]) { case 't': pb->SetLogTimestamp(true); break; @@ -1027,7 +1027,7 @@ TVector<TString> Subvalues(const TCgiParameters& e, const TString& key) return TVector<TString>(); } else { TVector<TString> ret; - for (const TString& s : SplitString(e.Get(key), ":", 0, KEEP_EMPTY_TOKENS)) { + for (const TString& s : SplitString(e.Get(key), ":", 0, KEEP_EMPTY_TOKENS)) { ret.push_back(UnescapeSubvalue(s)); } if (ret.empty()) { @@ -1039,7 +1039,7 @@ TVector<TString> Subvalues(const TCgiParameters& e, const TString& key) TString ParseTagsOut(const TString& taggedStr, TTags& tags) { - auto vec = SplitString(taggedStr, "-"); + auto vec = SplitString(taggedStr, "-"); if (vec.empty()) { return ""; } @@ -4363,12 +4363,12 @@ private: SeriesSelectors(out, e, "xn", "yns", data); out.Clear(); out << NMonitoring::HTTPOKJSON; - out << ToJsonFlot(data, xn, SplitString(e.Get("yns"), ":")); + out << ToJsonFlot(data, xn, SplitString(e.Get("yns"), ":")); } else if (outFormat == "flot") { SeriesSelectors(out, e, "xn", "yns", data); TString selectors = out.Str(); - TVector<TString> ynos = SplitString(e.Get("yns"), ":"); + TVector<TString> ynos = SplitString(e.Get("yns"), ":"); out.Clear(); out << NMonitoring::HTTPOKHTML; out << "<!DOCTYPE html>" << Endl; diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp index ffd610d21e..85f4ac5d69 100644 --- a/library/cpp/string_utils/url/url.cpp +++ b/library/cpp/string_utils/url/url.cpp @@ -62,17 +62,17 @@ namespace { } } -namespace NUrl { - - TSplitUrlToHostAndPathResult SplitUrlToHostAndPath(const TStringBuf url) { - TStringBuf host = GetSchemeHostAndPort(url, /*trimHttp=*/false, /*trimDefaultPort=*/false); - TStringBuf path = url; - path.SkipPrefix(host); - return {host, path}; - } - -} // namespace NUrl - +namespace NUrl { + + TSplitUrlToHostAndPathResult SplitUrlToHostAndPath(const TStringBuf url) { + TStringBuf host = GetSchemeHostAndPort(url, /*trimHttp=*/false, /*trimDefaultPort=*/false); + TStringBuf path = url; + path.SkipPrefix(host); + return {host, path}; + } + +} // namespace NUrl + size_t GetHttpPrefixSize(const char* url, bool ignorehttps) noexcept { return GetHttpPrefixSizeImpl<char>(url, TUncheckedSize(), ignorehttps); } @@ -183,13 +183,13 @@ TStringBuf GetSchemeHostAndPort(const TStringBuf url, bool trimHttp, bool trimDe } void SplitUrlToHostAndPath(const TStringBuf url, TStringBuf& host, TStringBuf& path) { - auto [hostBuf, pathBuf] = NUrl::SplitUrlToHostAndPath(url); - host = hostBuf; - path = pathBuf; + auto [hostBuf, pathBuf] = NUrl::SplitUrlToHostAndPath(url); + host = hostBuf; + path = pathBuf; } void SplitUrlToHostAndPath(const TStringBuf url, TString& host, TString& path) { - auto [hostBuf, pathBuf] = NUrl::SplitUrlToHostAndPath(url); + auto [hostBuf, pathBuf] = NUrl::SplitUrlToHostAndPath(url); host = hostBuf; path = pathBuf; } diff --git a/library/cpp/string_utils/url/url.h b/library/cpp/string_utils/url/url.h index ab8924cdc2..84137ccc57 100644 --- a/library/cpp/string_utils/url/url.h +++ b/library/cpp/string_utils/url/url.h @@ -1,28 +1,28 @@ #pragma once #include <util/generic/fwd.h> -#include <util/generic/strbuf.h> - -namespace NUrl { - - /** - * Splits URL to host and path - * Example: - * auto [host, path] = SplitUrlToHostAndPath(url); - * - * @param[in] url any URL - * @param[out] <host, path> parsed host and path - */ - struct TSplitUrlToHostAndPathResult { - TStringBuf host; - TStringBuf path; - }; - - Y_PURE_FUNCTION - TSplitUrlToHostAndPathResult SplitUrlToHostAndPath(const TStringBuf url); - -} // namespace NUrl - +#include <util/generic/strbuf.h> + +namespace NUrl { + + /** + * Splits URL to host and path + * Example: + * auto [host, path] = SplitUrlToHostAndPath(url); + * + * @param[in] url any URL + * @param[out] <host, path> parsed host and path + */ + struct TSplitUrlToHostAndPathResult { + TStringBuf host; + TStringBuf path; + }; + + Y_PURE_FUNCTION + TSplitUrlToHostAndPathResult SplitUrlToHostAndPath(const TStringBuf url); + +} // namespace NUrl + Y_PURE_FUNCTION size_t GetHttpPrefixSize(const char* url, bool ignorehttps = false) noexcept; Y_PURE_FUNCTION |