aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/string.cpp
diff options
context:
space:
mode:
authorIlnur Khuziev <ilnur.khuziev@yandex.ru>2022-02-10 16:46:13 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:13 +0300
commit736dcd8ca259457a136f2f9f9168c44643914323 (patch)
treeddd46a036d68bfa83aa11b892f31243ea6b068a1 /util/generic/string.cpp
parent9bf2fa2b060c9881d3135c2208c624a1dd546ecc (diff)
downloadydb-736dcd8ca259457a136f2f9f9168c44643914323.tar.gz
Restoring authorship annotation for Ilnur Khuziev <ilnur.khuziev@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/string.cpp')
-rw-r--r--util/generic/string.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/util/generic/string.cpp b/util/generic/string.cpp
index 3c655f1f66..6242c45685 100644
--- a/util/generic/string.cpp
+++ b/util/generic/string.cpp
@@ -80,7 +80,7 @@ template <>
bool TBasicString<wchar16, std::char_traits<wchar16>>::to_title(size_t pos, size_t n) {
return ToTitle(*this, pos, n);
}
-
+
template <>
TUtf32String&
TBasicString<wchar32, std::char_traits<wchar32>>::AppendAscii(const ::TStringBuf& s) {
@@ -112,9 +112,9 @@ TBasicString<char, std::char_traits<char>>::AppendUtf16(const ::TWtringBuf& s) {
template <>
TUtf32String&
TBasicString<wchar32, std::char_traits<wchar32>>::AppendUtf8(const ::TStringBuf& s) {
- size_t oldSize = size();
+ size_t oldSize = size();
ReserveAndResize(size() + s.size() * 4);
- size_t written = 0;
+ size_t written = 0;
size_t pos = UTF8ToWideImpl(s.data(), s.size(), begin() + oldSize, written);
if (pos != s.size()) {
ythrow yexception() << "failed to decode UTF-8 string at pos " << pos << ::NDetail::InStringMsg(s.data(), s.size());
@@ -122,35 +122,35 @@ TBasicString<wchar32, std::char_traits<wchar32>>::AppendUtf8(const ::TStringBuf&
resize(oldSize + written);
return *this;
-}
-
+}
+
template <>
TUtf32String&
TBasicString<wchar32, std::char_traits<wchar32>>::AppendUtf16(const ::TWtringBuf& s) {
- size_t oldSize = size();
+ size_t oldSize = size();
ReserveAndResize(size() + s.size() * 2);
-
- wchar32* oldEnd = begin() + oldSize;
- wchar32* end = oldEnd;
+
+ wchar32* oldEnd = begin() + oldSize;
+ wchar32* end = oldEnd;
NDetail::UTF16ToUTF32ImplScalar(s.data(), s.data() + s.size(), end);
- size_t written = end - oldEnd;
-
+ size_t written = end - oldEnd;
+
resize(oldSize + written);
-
+
return *this;
-}
-
+}
+
template <>
bool TBasicString<wchar32, std::char_traits<wchar32>>::to_lower(size_t pos, size_t n) {
return ToLower(*this, pos, n);
-}
-
+}
+
template <>
bool TBasicString<wchar32, std::char_traits<wchar32>>::to_upper(size_t pos, size_t n) {
return ToUpper(*this, pos, n);
-}
-
+}
+
template <>
bool TBasicString<wchar32, std::char_traits<wchar32>>::to_title(size_t pos, size_t n) {
return ToTitle(*this, pos, n);
-}
+}