diff options
author | cobat <cobat@yandex-team.ru> | 2022-02-10 16:49:07 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:07 +0300 |
commit | 1d2e8a8e9976488ea69a7e4763aa749244f82612 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/string | |
parent | e486e109b08823b61996f2154f0bc6b7c27a4af4 (diff) | |
download | ydb-1d2e8a8e9976488ea69a7e4763aa749244f82612.tar.gz |
Restoring authorship annotation for <cobat@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string')
-rw-r--r-- | util/string/cast.cpp | 6 | ||||
-rw-r--r-- | util/string/strip.h | 14 | ||||
-rw-r--r-- | util/string/type.h | 6 | ||||
-rw-r--r-- | util/string/util.h | 10 |
4 files changed, 18 insertions, 18 deletions
diff --git a/util/string/cast.cpp b/util/string/cast.cpp index 560fb220440..aa1e65a8e90 100644 --- a/util/string/cast.cpp +++ b/util/string/cast.cpp @@ -788,7 +788,7 @@ namespace { static inline size_t DoDtoa(double d, char* buf, size_t len, int prec) noexcept { TBuilder sb(buf, len); - Y_VERIFY(ToStringConverterNoPad().ToPrecision(d, prec, sb.SB), "conversion failed"); + Y_VERIFY(ToStringConverterNoPad().ToPrecision(d, prec, sb.SB), "conversion failed"); return FixEnd(buf, FixZeros(buf, sb.SB->position())); } @@ -808,7 +808,7 @@ size_t FloatToString(float t, char* buf, size_t len, EFloatToStringMode mode, in if (mode == PREC_AUTO) { TBuilder sb(buf, len); - Y_VERIFY(ToStringConverterNoPad().ToShortestSingle(t, sb.SB), "conversion failed"); + Y_VERIFY(ToStringConverterNoPad().ToShortestSingle(t, sb.SB), "conversion failed"); return FixEnd(buf, sb.SB->position()); } @@ -827,7 +827,7 @@ size_t FloatToString(double t, char* buf, size_t len, EFloatToStringMode mode, i TBuilder sb(buf, len); if (mode == PREC_AUTO) { - Y_VERIFY(ToStringConverterNoPad().ToShortest(t, sb.SB), "conversion failed"); + Y_VERIFY(ToStringConverterNoPad().ToShortest(t, sb.SB), "conversion failed"); return FixEnd(buf, sb.SB->position()); } diff --git a/util/string/strip.h b/util/string/strip.h index cde1e1d0388..d5ef6da96db 100644 --- a/util/string/strip.h +++ b/util/string/strip.h @@ -177,18 +177,18 @@ static inline T StripStringRight(const T& from, TStripCriterion&& criterion) { return TStripImpl<false, true>::StripString(from, criterion); } -/// Copies the given string removing leading and trailing spaces. +/// Copies the given string removing leading and trailing spaces. static inline bool Strip(const TString& from, TString& to) { return StripString(from, to); } -/// Removes leading and trailing spaces from the string. +/// Removes leading and trailing spaces from the string. inline TString& StripInPlace(TString& s) { Strip(s, s); return s; } -/// Returns a copy of the given string with removed leading and trailing spaces. +/// Returns a copy of the given string with removed leading and trailing spaces. inline TString Strip(const TString& s) Y_WARN_UNUSED_RESULT; inline TString Strip(const TString& s) { TString ret = s; @@ -232,13 +232,13 @@ bool CollapseImpl(const TStringType& from, TStringType& to, size_t maxLen, const bool Collapse(const TString& from, TString& to, size_t maxLen = 0); -/// Replaces several consequtive space symbols with one (processing is limited to maxLen bytes) +/// Replaces several consequtive space symbols with one (processing is limited to maxLen bytes) inline TString& CollapseInPlace(TString& s, size_t maxLen = 0) { Collapse(s, s, maxLen); return s; } -/// Replaces several consequtive space symbols with one (processing is limited to maxLen bytes) +/// Replaces several consequtive space symbols with one (processing is limited to maxLen bytes) inline TString Collapse(const TString& s, size_t maxLen = 0) Y_WARN_UNUSED_RESULT; inline TString Collapse(const TString& s, size_t maxLen) { TString ret; @@ -248,8 +248,8 @@ inline TString Collapse(const TString& s, size_t maxLen) { void CollapseText(const TString& from, TString& to, size_t maxLen); -/// The same as Collapse() + truncates the string to maxLen. -/// @details An ellipsis is inserted at the end of the truncated line. +/// The same as Collapse() + truncates the string to maxLen. +/// @details An ellipsis is inserted at the end of the truncated line. inline void CollapseText(TString& s, size_t maxLen) { TString to; CollapseText(s, to, maxLen); diff --git a/util/string/type.h b/util/string/type.h index 9602f260d1d..d6cb29ea589 100644 --- a/util/string/type.h +++ b/util/string/type.h @@ -4,17 +4,17 @@ Y_PURE_FUNCTION bool IsSpace(const char* s, size_t len) noexcept; -/// Checks if a string is a set of only space symbols. +/// Checks if a string is a set of only space symbols. Y_PURE_FUNCTION static inline bool IsSpace(const TStringBuf s) noexcept { return IsSpace(s.data(), s.size()); } -/// Returns "true" if the given string is an arabic number ([0-9]+) +/// Returns "true" if the given string is an arabic number ([0-9]+) Y_PURE_FUNCTION bool IsNumber(const TStringBuf s) noexcept; Y_PURE_FUNCTION bool IsNumber(const TWtringBuf s) noexcept; -/// Returns "true" if the given string is a hex number ([0-9a-fA-F]+) +/// Returns "true" if the given string is a hex number ([0-9a-fA-F]+) Y_PURE_FUNCTION bool IsHexNumber(const TStringBuf s) noexcept; Y_PURE_FUNCTION bool IsHexNumber(const TWtringBuf s) noexcept; diff --git a/util/string/util.h b/util/string/util.h index a958a7a1a40..0d77a5042b8 100644 --- a/util/string/util.h +++ b/util/string/util.h @@ -14,7 +14,7 @@ /// @{ int a2i(const TString& s); -/// Removes the last character if it is equal to c. +/// Removes the last character if it is equal to c. template <class T> inline void RemoveIfLast(T& s, int c) { const size_t length = s.length(); @@ -22,7 +22,7 @@ inline void RemoveIfLast(T& s, int c) { s.remove(length - 1); } -/// Adds lastCh symbol to the the of the string if it is not already there. +/// Adds lastCh symbol to the the of the string if it is not already there. inline void addIfNotLast(TString& s, int lastCh) { size_t len = s.length(); if (!len || s[len - 1] != lastCh) { @@ -30,9 +30,9 @@ inline void addIfNotLast(TString& s, int lastCh) { } } -/// @details Finishes the string with lastCh1 if lastCh2 is not present in the string and lastCh1 is not already at the end of the string. -/// Else, if lastCh2 is not equal to the symbol before the last, it finishes the string with lastCh2. -/// @todo ?? Define, when to apply the function. Is in use several times for URLs parsing. +/// @details Finishes the string with lastCh1 if lastCh2 is not present in the string and lastCh1 is not already at the end of the string. +/// Else, if lastCh2 is not equal to the symbol before the last, it finishes the string with lastCh2. +/// @todo ?? Define, when to apply the function. Is in use several times for URLs parsing. inline void addIfAbsent(TString& s, char lastCh1, char lastCh2) { size_t pos = s.find(lastCh2); if (pos == TString::npos) { |