diff options
author | sandello <sandello@yandex-team.ru> | 2022-02-10 16:49:52 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:52 +0300 |
commit | 0cdbcf332f1f329f0a3d6759462ad71e7867ac08 (patch) | |
tree | 6866207854e212f8179cb77bd1e2435e49743f66 /library/cpp/yt/string | |
parent | 3f5911a056d3dbc4bfd724740244a3a9c11575ef (diff) | |
download | ydb-0cdbcf332f1f329f0a3d6759462ad71e7867ac08.tar.gz |
Restoring authorship annotation for <sandello@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yt/string')
-rw-r--r-- | library/cpp/yt/string/format-inl.h | 6 | ||||
-rw-r--r-- | library/cpp/yt/string/format.h | 2 | ||||
-rw-r--r-- | library/cpp/yt/string/string.cpp | 16 | ||||
-rw-r--r-- | library/cpp/yt/string/string.h | 22 |
4 files changed, 23 insertions, 23 deletions
diff --git a/library/cpp/yt/string/format-inl.h b/library/cpp/yt/string/format-inl.h index 5484d4a216..00c6b77496 100644 --- a/library/cpp/yt/string/format-inl.h +++ b/library/cpp/yt/string/format-inl.h @@ -109,7 +109,7 @@ inline void FormatValue(TStringBuilderBase* builder, TStringBuf value, TStringBu } } -// TString +// TString inline void FormatValue(TStringBuilderBase* builder, const TString& value, TStringBuf format) { FormatValue(builder, TStringBuf(value), format); @@ -450,7 +450,7 @@ void FormatValueViaSprintf( auto copyFormat = [] (char* destination, const char* source, int length) { int position = 0; - for (int index = 0; index < length; ++index) { + for (int index = 0; index < length; ++index) { if (IsQuotationSpecSymbol(source[index])) { continue; } @@ -730,7 +730,7 @@ TString Format( } template <class... TArgs> -TString Format( +TString Format( TStringBuf format, TArgs&&... args) { diff --git a/library/cpp/yt/string/format.h b/library/cpp/yt/string/format.h index 9708fe5906..e3a6aa9c38 100644 --- a/library/cpp/yt/string/format.h +++ b/library/cpp/yt/string/format.h @@ -33,7 +33,7 @@ namespace NYT { * * The following argument types are supported: * - * Strings (including |const char*|, |TStringBuf|, and |TString|) and chars: + * Strings (including |const char*|, |TStringBuf|, and |TString|) and chars: * Emitted as is. Fast. * * Numerics and pointers: diff --git a/library/cpp/yt/string/string.cpp b/library/cpp/yt/string/string.cpp index 7440ac3fdd..b24a2c4aa5 100644 --- a/library/cpp/yt/string/string.cpp +++ b/library/cpp/yt/string/string.cpp @@ -13,22 +13,22 @@ namespace NYT { void UnderscoreCaseToCamelCase(TStringBuilderBase* builder, TStringBuf str) { - bool first = true; + bool first = true; bool upper = true; for (char c : str) { if (c == '_') { upper = true; } else { if (upper) { - if (!std::isalpha(c) && !first) { + if (!std::isalpha(c) && !first) { builder->AppendChar('_'); - } + } c = std::toupper(c); } builder->AppendChar(c); upper = false; } - first = false; + first = false; } } @@ -43,11 +43,11 @@ void CamelCaseToUnderscoreCase(TStringBuilderBase* builder, TStringBuf str) { bool first = true; for (char c : str) { - if (std::isupper(c) && std::isalpha(c)) { + if (std::isupper(c) && std::isalpha(c)) { if (!first) { builder->AppendChar('_'); } - c = std::tolower(c); + c = std::tolower(c); } builder->AppendChar(c); first = false; @@ -63,7 +63,7 @@ TString CamelCaseToUnderscoreCase(TStringBuf str) //////////////////////////////////////////////////////////////////////////////// -TString TrimLeadingWhitespaces(const TString& str) +TString TrimLeadingWhitespaces(const TString& str) { for (int i = 0; i < static_cast<int>(str.size()); ++i) { if (str[i] != ' ') { @@ -73,7 +73,7 @@ TString TrimLeadingWhitespaces(const TString& str) return ""; } -TString Trim(const TString& str, const TString& whitespaces) +TString Trim(const TString& str, const TString& whitespaces) { size_t end = str.size(); while (end > 0) { diff --git a/library/cpp/yt/string/string.h b/library/cpp/yt/string/string.h index ae6c99caab..b2b4ef23fd 100644 --- a/library/cpp/yt/string/string.h +++ b/library/cpp/yt/string/string.h @@ -64,7 +64,7 @@ void JoinToString( } template <class TIterator, class TFormatter> -TString JoinToString( +TString JoinToString( const TIterator& begin, const TIterator& end, const TFormatter& formatter, @@ -77,7 +77,7 @@ TString JoinToString( //! A handy shortcut with default formatter. template <class TIterator> -TString JoinToString( +TString JoinToString( const TIterator& begin, const TIterator& end, TStringBuf delimiter = DefaultJoinToStringDelimiter) @@ -92,7 +92,7 @@ TString JoinToString( * \param delimiter A delimiter to be inserted between items; ", " by default. */ template <class TCollection, class TFormatter> -TString JoinToString( +TString JoinToString( const TCollection& collection, const TFormatter& formatter, TStringBuf delimiter = DefaultJoinToStringDelimiter) @@ -104,7 +104,7 @@ TString JoinToString( //! A handy shortcut with the default formatter. template <class TCollection> -TString JoinToString( +TString JoinToString( const TCollection& collection, TStringBuf delimiter = DefaultJoinToStringDelimiter) { @@ -127,13 +127,13 @@ TString ConcatToString(Ts... args) //! Converts a range of items into strings. template <class TIter, class TFormatter> -std::vector<TString> ConvertToStrings( +std::vector<TString> ConvertToStrings( const TIter& begin, const TIter& end, const TFormatter& formatter, size_t maxSize = std::numeric_limits<size_t>::max()) { - std::vector<TString> result; + std::vector<TString> result; for (auto it = begin; it != end; ++it) { TStringBuilder builder; formatter(&builder, *it); @@ -147,7 +147,7 @@ std::vector<TString> ConvertToStrings( //! A handy shortcut with the default formatter. template <class TIter> -std::vector<TString> ConvertToStrings( +std::vector<TString> ConvertToStrings( const TIter& begin, const TIter& end, size_t maxSize = std::numeric_limits<size_t>::max()) @@ -162,7 +162,7 @@ std::vector<TString> ConvertToStrings( * \param maxSize Size limit for the resulting vector. */ template <class TCollection, class TFormatter> -std::vector<TString> ConvertToStrings( +std::vector<TString> ConvertToStrings( const TCollection& collection, const TFormatter& formatter, size_t maxSize = std::numeric_limits<size_t>::max()) @@ -174,7 +174,7 @@ std::vector<TString> ConvertToStrings( //! A handy shortcut with default formatter. template <class TCollection> -std::vector<TString> ConvertToStrings( +std::vector<TString> ConvertToStrings( const TCollection& collection, size_t maxSize = std::numeric_limits<size_t>::max()) { @@ -189,8 +189,8 @@ TString UnderscoreCaseToCamelCase(TStringBuf str); void CamelCaseToUnderscoreCase(TStringBuilderBase* builder, TStringBuf str); TString CamelCaseToUnderscoreCase(TStringBuf str); -TString TrimLeadingWhitespaces(const TString& str); -TString Trim(const TString& str, const TString& whitespaces); +TString TrimLeadingWhitespaces(const TString& str); +TString Trim(const TString& str, const TString& whitespaces); //////////////////////////////////////////////////////////////////////////////// |