aboutsummaryrefslogtreecommitdiffstats
path: root/util/string
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.ru>2022-02-10 16:45:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:08 +0300
commit4e839db24a3bbc9f1c610c43d6faaaa99824dcca (patch)
tree506dac10f5df94fab310584ee51b24fc5a081c22 /util/string
parent2d37894b1b037cf24231090eda8589bbb44fb6fc (diff)
downloadydb-4e839db24a3bbc9f1c610c43d6faaaa99824dcca.tar.gz
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string')
-rw-r--r--util/string/cast.cpp16
-rw-r--r--util/string/escape.cpp4
-rw-r--r--util/string/escape.h22
-rw-r--r--util/string/join.h180
-rw-r--r--util/string/printf.h2
-rw-r--r--util/string/split.h10
-rw-r--r--util/string/split_ut.cpp10
-rw-r--r--util/string/subst_ut.cpp4
-rw-r--r--util/string/type.cpp38
-rw-r--r--util/string/type.h36
-rw-r--r--util/string/type_ut.cpp12
11 files changed, 167 insertions, 167 deletions
diff --git a/util/string/cast.cpp b/util/string/cast.cpp
index aa1e65a8e9..bc0f7e09e6 100644
--- a/util/string/cast.cpp
+++ b/util/string/cast.cpp
@@ -325,7 +325,7 @@ namespace {
[[noreturn]] static Y_NO_INLINE void ThrowParseError(EParseStatus status, const TChar* data, size_t len, const TChar* pos) {
Y_ASSERT(status != PS_OK);
- typedef TBasicString<TChar> TStringType;
+ typedef TBasicString<TChar> TStringType;
switch (status) {
case PS_EMPTY_STRING:
@@ -443,13 +443,13 @@ DEF_INT_SPEC(int)
DEF_INT_SPEC(long)
DEF_INT_SPEC(long long)
-#ifdef __cpp_char8_t
-template <>
-size_t ToStringImpl<char8_t>(char8_t value, char* buf, size_t len) {
- return FormatInt<ui64, 10, char>(value, buf, len);
-}
-#endif
-
+#ifdef __cpp_char8_t
+template <>
+size_t ToStringImpl<char8_t>(char8_t value, char* buf, size_t len) {
+ return FormatInt<ui64, 10, char>(value, buf, len);
+}
+#endif
+
using TCharIType = std::conditional_t<std::is_signed<char>::value, i64, ui64>;
using TWCharIType = std::conditional_t<std::is_signed<wchar_t>::value, i64, ui64>;
diff --git a/util/string/escape.cpp b/util/string/escape.cpp
index cd09a7dbd0..d5067ba156 100644
--- a/util/string/escape.cpp
+++ b/util/string/escape.cpp
@@ -149,7 +149,7 @@ namespace {
}
template <class TChar>
-TBasicString<TChar>& EscapeCImpl(const TChar* str, size_t len, TBasicString<TChar>& r) {
+TBasicString<TChar>& EscapeCImpl(const TChar* str, size_t len, TBasicString<TChar>& r) {
using TEscapeUtil = ::TEscapeUtil<TChar>;
TChar buffer[TEscapeUtil::ESCAPE_C_BUFFER_SIZE];
@@ -331,7 +331,7 @@ static TStr& DoUnescapeC(const TChar* p, size_t sz, TStr& res) {
}
template <class TChar>
-TBasicString<TChar>& UnescapeCImpl(const TChar* p, size_t sz, TBasicString<TChar>& res) {
+TBasicString<TChar>& UnescapeCImpl(const TChar* p, size_t sz, TBasicString<TChar>& res) {
return DoUnescapeC(p, sz, res);
}
diff --git a/util/string/escape.h b/util/string/escape.h
index b01be65b0e..91120fc292 100644
--- a/util/string/escape.h
+++ b/util/string/escape.h
@@ -4,48 +4,48 @@
#include <util/generic/strbuf.h>
template <class TChar>
-TBasicString<TChar>& EscapeCImpl(const TChar* str, size_t len, TBasicString<TChar>&);
+TBasicString<TChar>& EscapeCImpl(const TChar* str, size_t len, TBasicString<TChar>&);
template <class TChar>
-TBasicString<TChar>& UnescapeCImpl(const TChar* str, size_t len, TBasicString<TChar>&);
+TBasicString<TChar>& UnescapeCImpl(const TChar* str, size_t len, TBasicString<TChar>&);
template <class TChar>
TChar* UnescapeC(const TChar* str, size_t len, TChar* buf);
template <typename TChar>
-static inline TBasicString<TChar>& EscapeC(const TChar* str, size_t len, TBasicString<TChar>& s) {
+static inline TBasicString<TChar>& EscapeC(const TChar* str, size_t len, TBasicString<TChar>& s) {
return EscapeCImpl(str, len, s);
}
template <typename TChar>
-static inline TBasicString<TChar> EscapeC(const TChar* str, size_t len) {
- TBasicString<TChar> s;
+static inline TBasicString<TChar> EscapeC(const TChar* str, size_t len) {
+ TBasicString<TChar> s;
return EscapeC(str, len, s);
}
template <typename TChar>
-static inline TBasicString<TChar> EscapeC(const TBasicStringBuf<TChar>& str) {
+static inline TBasicString<TChar> EscapeC(const TBasicStringBuf<TChar>& str) {
return EscapeC(str.data(), str.size());
}
template <typename TChar>
-static inline TBasicString<TChar>& UnescapeC(const TChar* str, size_t len, TBasicString<TChar>& s) {
+static inline TBasicString<TChar>& UnescapeC(const TChar* str, size_t len, TBasicString<TChar>& s) {
return UnescapeCImpl(str, len, s);
}
template <typename TChar>
-static inline TBasicString<TChar> UnescapeC(const TChar* str, size_t len) {
- TBasicString<TChar> s;
+static inline TBasicString<TChar> UnescapeC(const TChar* str, size_t len) {
+ TBasicString<TChar> s;
return UnescapeCImpl(str, len, s);
}
template <typename TChar>
-static inline TBasicString<TChar> EscapeC(TChar ch) {
+static inline TBasicString<TChar> EscapeC(TChar ch) {
return EscapeC(&ch, 1);
}
template <typename TChar>
-static inline TBasicString<TChar> EscapeC(const TChar* str) {
+static inline TBasicString<TChar> EscapeC(const TChar* str) {
return EscapeC(str, std::char_traits<TChar>::length(str));
}
diff --git a/util/string/join.h b/util/string/join.h
index b166fad1f3..c96dc5132a 100644
--- a/util/string/join.h
+++ b/util/string/join.h
@@ -19,26 +19,26 @@
* For standard types (strings of all kinds and arithmetic types) we don't use a temporary TString in AppendToString().
*/
-template <typename TCharType, typename T>
+template <typename TCharType, typename T>
inline std::enable_if_t<!std::is_arithmetic<std::remove_cv_t<T>>::value, void>
-AppendToString(TBasicString<TCharType>& dst, const T& t) {
+AppendToString(TBasicString<TCharType>& dst, const T& t) {
dst.AppendNoAlias(ToString(t));
}
-template <typename TCharType, typename T>
+template <typename TCharType, typename T>
inline std::enable_if_t<std::is_arithmetic<std::remove_cv_t<T>>::value, void>
-AppendToString(TBasicString<TCharType>& dst, const T& t) {
+AppendToString(TBasicString<TCharType>& dst, const T& t) {
char buf[512];
dst.append(buf, ToString<std::remove_cv_t<T>>(t, buf, sizeof(buf)));
}
-template <typename TCharType>
-inline void AppendToString(TBasicString<TCharType>& dst, const TCharType* t) {
+template <typename TCharType>
+inline void AppendToString(TBasicString<TCharType>& dst, const TCharType* t) {
dst.append(t);
}
-template <typename TCharType>
-inline void AppendToString(TBasicString<TCharType>& dst, TBasicStringBuf<TCharType> t) {
+template <typename TCharType>
+inline void AppendToString(TBasicString<TCharType>& dst, TBasicStringBuf<TCharType> t) {
dst.append(t);
}
@@ -75,12 +75,12 @@ namespace NPrivate {
}
}
-template <typename TCharType>
-inline void AppendJoinNoReserve(TBasicString<TCharType>&, TBasicStringBuf<TCharType>) {
+template <typename TCharType>
+inline void AppendJoinNoReserve(TBasicString<TCharType>&, TBasicStringBuf<TCharType>) {
}
-template <typename TCharType, typename TFirst, typename... TRest>
-inline void AppendJoinNoReserve(TBasicString<TCharType>& dst, TBasicStringBuf<TCharType> delim, const TFirst& f, const TRest&... r) {
+template <typename TCharType, typename TFirst, typename... TRest>
+inline void AppendJoinNoReserve(TBasicString<TCharType>& dst, TBasicStringBuf<TCharType> delim, const TFirst& f, const TRest&... r) {
AppendToString(dst, delim);
AppendToString(dst, f);
AppendJoinNoReserve(dst, delim, r...);
@@ -110,93 +110,93 @@ inline TString Join(char cdelim, const TValues&... v) {
return Join(TStringBuf(&cdelim, 1), v...);
}
-namespace NPrivate {
- template <typename TCharType, typename TIter>
- inline TBasicString<TCharType> JoinRange(TBasicStringBuf<TCharType> delim, const TIter beg, const TIter end) {
- TBasicString<TCharType> out;
- if (beg != end) {
- size_t total = ::NPrivate::GetLength(*beg);
- for (TIter pos = beg; ++pos != end;) {
- total += delim.length() + ::NPrivate::GetLength(*pos);
- }
- if (total > 0) {
- out.reserve(total);
- }
-
- AppendToString(out, *beg);
- for (TIter pos = beg; ++pos != end;) {
- AppendJoinNoReserve(out, delim, *pos);
- }
+namespace NPrivate {
+ template <typename TCharType, typename TIter>
+ inline TBasicString<TCharType> JoinRange(TBasicStringBuf<TCharType> delim, const TIter beg, const TIter end) {
+ TBasicString<TCharType> out;
+ if (beg != end) {
+ size_t total = ::NPrivate::GetLength(*beg);
+ for (TIter pos = beg; ++pos != end;) {
+ total += delim.length() + ::NPrivate::GetLength(*pos);
+ }
+ if (total > 0) {
+ out.reserve(total);
+ }
+
+ AppendToString(out, *beg);
+ for (TIter pos = beg; ++pos != end;) {
+ AppendJoinNoReserve(out, delim, *pos);
+ }
}
- return out;
+ return out;
}
-} // namespace NPrivate
-
-template <typename TIter>
-TString JoinRange(std::string_view delim, const TIter beg, const TIter end) {
- return ::NPrivate::JoinRange<char>(delim, beg, end);
-}
-
-template <typename TIter>
-TString JoinRange(char delim, const TIter beg, const TIter end) {
- TStringBuf delimBuf(&delim, 1);
- return ::NPrivate::JoinRange<char>(delimBuf, beg, end);
-}
-
-template <typename TIter>
-TUtf16String JoinRange(std::u16string_view delim, const TIter beg, const TIter end) {
- return ::NPrivate::JoinRange<wchar16>(delim, beg, end);
-}
-
-template <typename TIter>
-TUtf16String JoinRange(wchar16 delim, const TIter beg, const TIter end) {
- TWtringBuf delimBuf(&delim, 1);
- return ::NPrivate::JoinRange<wchar16>(delimBuf, beg, end);
-}
-
-template <typename TIter>
-TUtf32String JoinRange(std::u32string_view delim, const TIter beg, const TIter end) {
- return ::NPrivate::JoinRange<wchar32>(delim, beg, end);
-}
-
-template <typename TIter>
-TUtf32String JoinRange(wchar32 delim, const TIter beg, const TIter end) {
- TUtf32StringBuf delimBuf(&delim, 1);
- return ::NPrivate::JoinRange<wchar32>(delimBuf, beg, end);
-}
-
-template <typename TCharType, typename TContainer>
-inline TBasicString<TCharType> JoinSeq(std::basic_string_view<TCharType> delim, const TContainer& data) {
+} // namespace NPrivate
+
+template <typename TIter>
+TString JoinRange(std::string_view delim, const TIter beg, const TIter end) {
+ return ::NPrivate::JoinRange<char>(delim, beg, end);
+}
+
+template <typename TIter>
+TString JoinRange(char delim, const TIter beg, const TIter end) {
+ TStringBuf delimBuf(&delim, 1);
+ return ::NPrivate::JoinRange<char>(delimBuf, beg, end);
+}
+
+template <typename TIter>
+TUtf16String JoinRange(std::u16string_view delim, const TIter beg, const TIter end) {
+ return ::NPrivate::JoinRange<wchar16>(delim, beg, end);
+}
+
+template <typename TIter>
+TUtf16String JoinRange(wchar16 delim, const TIter beg, const TIter end) {
+ TWtringBuf delimBuf(&delim, 1);
+ return ::NPrivate::JoinRange<wchar16>(delimBuf, beg, end);
+}
+
+template <typename TIter>
+TUtf32String JoinRange(std::u32string_view delim, const TIter beg, const TIter end) {
+ return ::NPrivate::JoinRange<wchar32>(delim, beg, end);
+}
+
+template <typename TIter>
+TUtf32String JoinRange(wchar32 delim, const TIter beg, const TIter end) {
+ TUtf32StringBuf delimBuf(&delim, 1);
+ return ::NPrivate::JoinRange<wchar32>(delimBuf, beg, end);
+}
+
+template <typename TCharType, typename TContainer>
+inline TBasicString<TCharType> JoinSeq(std::basic_string_view<TCharType> delim, const TContainer& data) {
using std::begin;
using std::end;
return JoinRange(delim, begin(data), end(data));
}
-template <typename TCharType, typename TContainer>
-inline TBasicString<TCharType> JoinSeq(const TCharType* delim, const TContainer& data) {
- TBasicStringBuf<TCharType> delimBuf = delim;
- return JoinSeq(delimBuf, data);
-}
-
-template <typename TCharType, typename TContainer>
-inline TBasicString<TCharType> JoinSeq(const TBasicString<TCharType>& delim, const TContainer& data) {
- TBasicStringBuf<TCharType> delimBuf = delim;
- return JoinSeq(delimBuf, data);
-}
-
-template <typename TCharType, typename TContainer>
-inline std::enable_if_t<
- std::is_same_v<TCharType, char> ||
- std::is_same_v<TCharType, char16_t> ||
- std::is_same_v<TCharType, char32_t>,
- TBasicString<TCharType>>
-JoinSeq(TCharType delim, const TContainer& data) {
- TBasicStringBuf<TCharType> delimBuf(&delim, 1);
- return JoinSeq(delimBuf, data);
-}
-
+template <typename TCharType, typename TContainer>
+inline TBasicString<TCharType> JoinSeq(const TCharType* delim, const TContainer& data) {
+ TBasicStringBuf<TCharType> delimBuf = delim;
+ return JoinSeq(delimBuf, data);
+}
+
+template <typename TCharType, typename TContainer>
+inline TBasicString<TCharType> JoinSeq(const TBasicString<TCharType>& delim, const TContainer& data) {
+ TBasicStringBuf<TCharType> delimBuf = delim;
+ return JoinSeq(delimBuf, data);
+}
+
+template <typename TCharType, typename TContainer>
+inline std::enable_if_t<
+ std::is_same_v<TCharType, char> ||
+ std::is_same_v<TCharType, char16_t> ||
+ std::is_same_v<TCharType, char32_t>,
+ TBasicString<TCharType>>
+JoinSeq(TCharType delim, const TContainer& data) {
+ TBasicStringBuf<TCharType> delimBuf(&delim, 1);
+ return JoinSeq(delimBuf, data);
+}
+
/** \brief Functor for streaming iterative objects from TIterB e to TIterE b, separated with delim.
* Difference from JoinSeq, JoinRange, Join is the lack of TString object - all depends on operator<< for the type and
* realization of IOutputStream
diff --git a/util/string/printf.h b/util/string/printf.h
index 925c6edaff..e5720b07c4 100644
--- a/util/string/printf.h
+++ b/util/string/printf.h
@@ -1,6 +1,6 @@
#pragma once
-#include <util/generic/fwd.h>
+#include <util/generic/fwd.h>
#include <util/system/compiler.h>
#include <cstdarg>
diff --git a/util/string/split.h b/util/string/split.h
index bc46d9e64c..5e6e532ee5 100644
--- a/util/string/split.h
+++ b/util/string/split.h
@@ -668,13 +668,13 @@ namespace NStringSplitPrivate {
}
template <
- typename Other,
+ typename Other,
typename = std::enable_if_t<
std::is_convertible<Other, TStringBufType>::value>>
- bool operator==(const Other& toCompare) const {
- return TStringBufType(*this) == TStringBufType(toCompare);
- }
-
+ bool operator==(const Other& toCompare) const {
+ return TStringBufType(*this) == TStringBufType(toCompare);
+ }
+
TIterator TokenStart() const noexcept {
return this->begin();
}
diff --git a/util/string/split_ut.cpp b/util/string/split_ut.cpp
index 43e59f2d75..958f0838b3 100644
--- a/util/string/split_ut.cpp
+++ b/util/string/split_ut.cpp
@@ -134,7 +134,7 @@ Y_UNIT_TEST_SUITE(SplitStringTest) {
TUtf16String data(u"qw ab qwabcab");
TUtf16String canonic[] = {u"qw", u"ab", TUtf16String(), u"qwabcab"};
TVector<TUtf16String> good(canonic, canonic + 4);
- TCharDelimiter<const wchar16> delim(' ');
+ TCharDelimiter<const wchar16> delim(' ');
TestDelimiterOnString<TContainerConsumer>(good, data.data(), delim);
TestDelimiterOnRange<TContainerConsumer>(good, data.data(), data.end(), delim);
@@ -192,7 +192,7 @@ Y_UNIT_TEST_SUITE(SplitStringTest) {
TUtf16String canonic[] = {u"qw ", u" qw", TUtf16String(), u"c", TUtf16String()};
TVector<TUtf16String> good(canonic, canonic + 5);
TUtf16String wideDelim(u"ab");
- TStringDelimiter<const wchar16> delim(wideDelim.data());
+ TStringDelimiter<const wchar16> delim(wideDelim.data());
TestDelimiterOnString<TContainerConsumer>(good, data.data(), delim);
TestDelimiterOnRange<TContainerConsumer>(good, data.data(), data.end(), delim);
@@ -213,7 +213,7 @@ Y_UNIT_TEST_SUITE(SplitStringTest) {
TUtf16String canonic[] = {u"q", u" ab q", u"abab", TUtf16String(), u"ab"};
TVector<TUtf16String> good(canonic, canonic + 5);
TUtf16String wideDelim(u"wc");
- TSetDelimiter<const wchar16> delim(wideDelim.data());
+ TSetDelimiter<const wchar16> delim(wideDelim.data());
TestDelimiterOnString<TContainerConsumer>(good, data.data(), delim);
}
@@ -223,7 +223,7 @@ Y_UNIT_TEST_SUITE(SplitStringTest) {
TUtf16String canonic[] = {u"q", u" ab q", u"abab", TUtf16String(), u"ab"};
TVector<TUtf16String> good(1);
TUtf16String wideDelim(u"wc");
- TSetDelimiter<const wchar16> delim(wideDelim.data());
+ TSetDelimiter<const wchar16> delim(wideDelim.data());
TVector<TUtf16String> test;
TContainerConsumer<TVector<TUtf16String>> consumer(&test);
@@ -654,7 +654,7 @@ Y_UNIT_TEST_SUITE(StringSplitter) {
TVector<TUtf16String> actual2 = {u"привет,", u"как", u"дела"};
num = 0;
- for (TWtringBuf elem : StringSplitter(u"привет, как дела").Split(wchar16(' '))) {
+ for (TWtringBuf elem : StringSplitter(u"привет, как дела").Split(wchar16(' '))) {
UNIT_ASSERT_VALUES_EQUAL(elem, actual2[num++]);
}
diff --git a/util/string/subst_ut.cpp b/util/string/subst_ut.cpp
index 21eccef779..dccdcfc9a4 100644
--- a/util/string/subst_ut.cpp
+++ b/util/string/subst_ut.cpp
@@ -162,7 +162,7 @@ Y_UNIT_TEST_SUITE(TStringSubst) {
Y_UNIT_TEST(TestSubstCharGlobal) {
TUtf16String w = u"abcdabcd";
- SubstGlobal(w, wchar16('b'), wchar16('B'), 3);
+ SubstGlobal(w, wchar16('b'), wchar16('B'), 3);
UNIT_ASSERT_EQUAL(w, u"abcdaBcd");
TString s = "aaa";
@@ -172,7 +172,7 @@ Y_UNIT_TEST_SUITE(TStringSubst) {
Y_UNIT_TEST(TestSubstCharGlobalRet) {
const TUtf16String w1 = u"abcdabcd";
- const TUtf16String w2 = SubstGlobalCopy(w1, wchar16('b'), wchar16('B'), 3);
+ const TUtf16String w2 = SubstGlobalCopy(w1, wchar16('b'), wchar16('B'), 3);
UNIT_ASSERT_EQUAL(w2, u"abcdaBcd");
const TString s1 = "aaa";
diff --git a/util/string/type.cpp b/util/string/type.cpp
index 49671c02c2..e8d9921911 100644
--- a/util/string/type.cpp
+++ b/util/string/type.cpp
@@ -1,8 +1,8 @@
#include "type.h"
#include "ascii.h"
-#include <array>
-
+#include <array>
+
bool IsSpace(const char* s, size_t len) noexcept {
if (len == 0) {
return false;
@@ -21,7 +21,7 @@ static bool IsNumberT(const TStringType& s) noexcept {
return false;
}
- return std::all_of(s.begin(), s.end(), IsAsciiDigit<typename TStringType::value_type>);
+ return std::all_of(s.begin(), s.end(), IsAsciiDigit<typename TStringType::value_type>);
}
bool IsNumber(const TStringBuf s) noexcept {
@@ -38,7 +38,7 @@ static bool IsHexNumberT(const TStringType& s) noexcept {
return false;
}
- return std::all_of(s.begin(), s.end(), IsAsciiHex<typename TStringType::value_type>);
+ return std::all_of(s.begin(), s.end(), IsAsciiHex<typename TStringType::value_type>);
}
bool IsHexNumber(const TStringBuf s) noexcept {
@@ -49,20 +49,20 @@ bool IsHexNumber(const TWtringBuf s) noexcept {
return IsHexNumberT(s);
}
-namespace {
- template <size_t N>
- bool IsCaseInsensitiveAnyOf(TStringBuf str, const std::array<TStringBuf, N>& options) {
- for (auto option : options) {
- if (str.size() == option.size() && ::strnicmp(str.data(), option.data(), str.size()) == 0) {
- return true;
- }
- }
+namespace {
+ template <size_t N>
+ bool IsCaseInsensitiveAnyOf(TStringBuf str, const std::array<TStringBuf, N>& options) {
+ for (auto option : options) {
+ if (str.size() == option.size() && ::strnicmp(str.data(), option.data(), str.size()) == 0) {
+ return true;
+ }
+ }
return false;
- }
-} //anonymous namespace
+ }
+} //anonymous namespace
-bool IsTrue(const TStringBuf v) noexcept {
- static constexpr std::array<TStringBuf, 7> trueOptions{
+bool IsTrue(const TStringBuf v) noexcept {
+ static constexpr std::array<TStringBuf, 7> trueOptions{
"true",
"t",
"yes",
@@ -70,11 +70,11 @@ bool IsTrue(const TStringBuf v) noexcept {
"on",
"1",
"da"};
- return IsCaseInsensitiveAnyOf(v, trueOptions);
+ return IsCaseInsensitiveAnyOf(v, trueOptions);
}
bool IsFalse(const TStringBuf v) noexcept {
- static constexpr std::array<TStringBuf, 7> falseOptions{
+ static constexpr std::array<TStringBuf, 7> falseOptions{
"false",
"f",
"no",
@@ -82,5 +82,5 @@ bool IsFalse(const TStringBuf v) noexcept {
"off",
"0",
"net"};
- return IsCaseInsensitiveAnyOf(v, falseOptions);
+ return IsCaseInsensitiveAnyOf(v, falseOptions);
}
diff --git a/util/string/type.h b/util/string/type.h
index d6cb29ea58..37d1f69b39 100644
--- a/util/string/type.h
+++ b/util/string/type.h
@@ -19,24 +19,24 @@ Y_PURE_FUNCTION bool IsHexNumber(const TStringBuf s) noexcept;
Y_PURE_FUNCTION bool IsHexNumber(const TWtringBuf s) noexcept;
-/* Tests if the given string is case insensitive equal to one of:
- * - "true",
- * - "t",
- * - "yes",
- * - "y",
- * - "on",
- * - "1",
- * - "da".
- */
+/* Tests if the given string is case insensitive equal to one of:
+ * - "true",
+ * - "t",
+ * - "yes",
+ * - "y",
+ * - "on",
+ * - "1",
+ * - "da".
+ */
Y_PURE_FUNCTION bool IsTrue(const TStringBuf value) noexcept;
-/* Tests if the given string is case insensitive equal to one of:
- * - "false",
- * - "f",
- * - "no",
- * - "n",
- * - "off",
- * - "0",
- * - "net".
- */
+/* Tests if the given string is case insensitive equal to one of:
+ * - "false",
+ * - "f",
+ * - "no",
+ * - "n",
+ * - "off",
+ * - "0",
+ * - "net".
+ */
Y_PURE_FUNCTION bool IsFalse(const TStringBuf value) noexcept;
diff --git a/util/string/type_ut.cpp b/util/string/type_ut.cpp
index 03e7af62bd..72f4513ac3 100644
--- a/util/string/type_ut.cpp
+++ b/util/string/type_ut.cpp
@@ -18,11 +18,11 @@ Y_UNIT_TEST_SUITE(TStringClassify) {
UNIT_ASSERT(IsTrue("YeS"));
UNIT_ASSERT(IsTrue("on"));
UNIT_ASSERT(IsTrue("true"));
- UNIT_ASSERT(IsTrue("t"));
+ UNIT_ASSERT(IsTrue("t"));
UNIT_ASSERT(IsTrue("da"));
- UNIT_ASSERT(!IsTrue(""));
- UNIT_ASSERT(!IsTrue("tr"));
+ UNIT_ASSERT(!IsTrue(""));
+ UNIT_ASSERT(!IsTrue("tr"));
UNIT_ASSERT(!IsTrue("foobar"));
}
@@ -31,11 +31,11 @@ Y_UNIT_TEST_SUITE(TStringClassify) {
UNIT_ASSERT(IsFalse("no"));
UNIT_ASSERT(IsFalse("off"));
UNIT_ASSERT(IsFalse("false"));
- UNIT_ASSERT(IsFalse("f"));
+ UNIT_ASSERT(IsFalse("f"));
UNIT_ASSERT(IsFalse("net"));
- UNIT_ASSERT(!IsFalse(""));
- UNIT_ASSERT(!IsFalse("fa"));
+ UNIT_ASSERT(!IsFalse(""));
+ UNIT_ASSERT(!IsFalse("fa"));
UNIT_ASSERT(!IsFalse("foobar"));
}