aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream
diff options
context:
space:
mode:
authortobo <tobo@yandex-team.ru>2022-02-10 16:47:27 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:27 +0300
commit7fe839092527589b38f014d854c51565b3c1adfa (patch)
tree309e97022d3530044b712b8f71318c78faf7856e /util/stream
parentd0d68c395c10da4cb56a1c845504570a04d7893e (diff)
downloadydb-7fe839092527589b38f014d854c51565b3c1adfa.tar.gz
Restoring authorship annotation for <tobo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/stream')
-rw-r--r--util/stream/aligned_ut.cpp4
-rw-r--r--util/stream/format.h8
-rw-r--r--util/stream/format_ut.cpp8
-rw-r--r--util/stream/hex.cpp2
-rw-r--r--util/stream/input.cpp2
-rw-r--r--util/stream/mem.cpp6
-rw-r--r--util/stream/output.cpp2
-rw-r--r--util/stream/tokenizer_ut.cpp18
-rw-r--r--util/stream/zlib_ut.cpp4
9 files changed, 27 insertions, 27 deletions
diff --git a/util/stream/aligned_ut.cpp b/util/stream/aligned_ut.cpp
index e980d05cf7..890dfa7d8f 100644
--- a/util/stream/aligned_ut.cpp
+++ b/util/stream/aligned_ut.cpp
@@ -16,7 +16,7 @@ protected:
}
*static_cast<unsigned char*>(buf) = static_cast<unsigned char>(Pos_);
- ++Pos_;
+ ++Pos_;
return 1;
}
@@ -25,7 +25,7 @@ protected:
return 0;
}
- ++Pos_;
+ ++Pos_;
return 1;
}
diff --git a/util/stream/format.h b/util/stream/format.h
index b033208a1b..e3cd64cc57 100644
--- a/util/stream/format.h
+++ b/util/stream/format.h
@@ -118,9 +118,9 @@ namespace NFormatPrivate {
if (value.Flags & HF_ADDX) {
if (Base == 16) {
- stream << TStringBuf("0x");
+ stream << TStringBuf("0x");
} else if (Base == 2) {
- stream << TStringBuf("0b");
+ stream << TStringBuf("0b");
}
}
@@ -329,7 +329,7 @@ static constexpr ::NFormatPrivate::TBaseNumber<T, 2> SBin(const T& value, const
*
* Example usage:
* @code
- * stream << HexText(TStringBuf("abcи")); // Will output "61 62 63 D0 B8"
+ * stream << HexText(TStringBuf("abcи")); // Will output "61 62 63 D0 B8"
* stream << HexText(TWtringBuf(u"abcи")); // Will output "0061 0062 0063 0438"
* @endcode
*
@@ -348,7 +348,7 @@ static inline ::NFormatPrivate::TBaseText<TChar, 16> HexText(const TBasicStringB
*
* Example usage:
* @code
- * stream << BinText(TStringBuf("aaa")); // Will output "01100001 01100001 01100001"
+ * stream << BinText(TStringBuf("aaa")); // Will output "01100001 01100001 01100001"
* @endcode
*
* @param value String to output.
diff --git a/util/stream/format_ut.cpp b/util/stream/format_ut.cpp
index 43245aeb48..9c1e7c7f9d 100644
--- a/util/stream/format_ut.cpp
+++ b/util/stream/format_ut.cpp
@@ -49,7 +49,7 @@ Y_UNIT_TEST_SUITE(TOutputStreamFormattingTest) {
Y_UNIT_TEST(TestHexText) {
{
TStringStream ss;
- ss << HexText(TStringBuf("abcи"));
+ ss << HexText(TStringBuf("abcи"));
UNIT_ASSERT_VALUES_EQUAL("61 62 63 D0 B8", ss.Str());
}
{
@@ -76,9 +76,9 @@ Y_UNIT_TEST_SUITE(TOutputStreamFormattingTest) {
}
Y_UNIT_TEST(TestBinText) {
- UNIT_ASSERT_VALUES_EQUAL(ToString(BinText(TStringBuf("\1"))), "00000001");
- UNIT_ASSERT_VALUES_EQUAL(ToString(BinText(TStringBuf("\1\1"))), "00000001 00000001");
- UNIT_ASSERT_VALUES_EQUAL(ToString(BinText(TStringBuf("aaa"))), "01100001 01100001 01100001");
+ UNIT_ASSERT_VALUES_EQUAL(ToString(BinText(TStringBuf("\1"))), "00000001");
+ UNIT_ASSERT_VALUES_EQUAL(ToString(BinText(TStringBuf("\1\1"))), "00000001 00000001");
+ UNIT_ASSERT_VALUES_EQUAL(ToString(BinText(TStringBuf("aaa"))), "01100001 01100001 01100001");
}
Y_UNIT_TEST(TestPrec) {
diff --git a/util/stream/hex.cpp b/util/stream/hex.cpp
index 1c05330504..dafcefebf7 100644
--- a/util/stream/hex.cpp
+++ b/util/stream/hex.cpp
@@ -16,7 +16,7 @@ void HexEncode(const void* in, size_t len, IOutputStream& out) {
}
void HexDecode(const void* in, size_t len, IOutputStream& out) {
- Y_ENSURE(!(len & 1), TStringBuf("Odd buffer length passed to HexDecode"));
+ Y_ENSURE(!(len & 1), TStringBuf("Odd buffer length passed to HexDecode"));
static const size_t NUM_OF_BYTES = 32;
char buffer[NUM_OF_BYTES];
diff --git a/util/stream/input.cpp b/util/stream/input.cpp
index 6e8170f2f9..6949bac9bc 100644
--- a/util/stream/input.cpp
+++ b/util/stream/input.cpp
@@ -28,7 +28,7 @@ size_t IInputStream::DoReadTo(TString& st, char to) {
size_t result = 0;
do {
- ++result;
+ ++result;
if (ch == to) {
break;
diff --git a/util/stream/mem.cpp b/util/stream/mem.cpp
index 22a3339e27..4f2b73082d 100644
--- a/util/stream/mem.cpp
+++ b/util/stream/mem.cpp
@@ -39,7 +39,7 @@ void TMemoryInput::DoUndo(size_t len) {
TMemoryOutput::~TMemoryOutput() = default;
size_t TMemoryOutput::DoNext(void** ptr) {
- Y_ENSURE(Buf_ < End_, TStringBuf("memory output stream exhausted"));
+ Y_ENSURE(Buf_ < End_, TStringBuf("memory output stream exhausted"));
*ptr = Buf_;
size_t bufferSize = End_ - Buf_;
Buf_ = End_;
@@ -53,13 +53,13 @@ void TMemoryOutput::DoUndo(size_t len) {
void TMemoryOutput::DoWrite(const void* buf, size_t len) {
char* end = Buf_ + len;
- Y_ENSURE(end <= End_, TStringBuf("memory output stream exhausted"));
+ Y_ENSURE(end <= End_, TStringBuf("memory output stream exhausted"));
memcpy(Buf_, buf, len);
Buf_ = end;
}
void TMemoryOutput::DoWriteC(char c) {
- Y_ENSURE(Buf_ < End_, TStringBuf("memory output stream exhausted"));
+ Y_ENSURE(Buf_ < End_, TStringBuf("memory output stream exhausted"));
*Buf_++ = c;
}
diff --git a/util/stream/output.cpp b/util/stream/output.cpp
index db81b81b70..a1992f6cf6 100644
--- a/util/stream/output.cpp
+++ b/util/stream/output.cpp
@@ -240,7 +240,7 @@ using TNullPtr = decltype(nullptr);
template <>
void Out<TNullPtr>(IOutputStream& o, TTypeTraits<TNullPtr>::TFuncParam) {
- o << TStringBuf("nullptr");
+ o << TStringBuf("nullptr");
}
#if defined(_android_)
diff --git a/util/stream/tokenizer_ut.cpp b/util/stream/tokenizer_ut.cpp
index afc566da86..37b30d8e5f 100644
--- a/util/stream/tokenizer_ut.cpp
+++ b/util/stream/tokenizer_ut.cpp
@@ -40,7 +40,7 @@ Y_UNIT_TEST_SUITE(TStreamTokenizerTests) {
Y_UNIT_TEST(LastTokenendDoesntSatisfyPredicateTest) {
const char data[] = "abc\ndef\nxxxxxx";
const auto dataSize = Y_ARRAY_SIZE(data) - 1;
- const TStringBuf tokens[] = {TStringBuf("abc"), TStringBuf("def"), TStringBuf("xxxxxx")};
+ const TStringBuf tokens[] = {TStringBuf("abc"), TStringBuf("def"), TStringBuf("xxxxxx")};
const auto tokensSize = Y_ARRAY_SIZE(tokens);
auto&& input = TMemoryInput{data, dataSize};
auto&& tokenizer = TStreamTokenizer<TEol>{&input};
@@ -58,7 +58,7 @@ Y_UNIT_TEST_SUITE(TStreamTokenizerTests) {
Y_UNIT_TEST(FirstTokenIsEmptyTest) {
const char data[] = "\ndef\nxxxxxx";
const auto dataSize = Y_ARRAY_SIZE(data) - 1;
- const TStringBuf tokens[] = {TStringBuf(), TStringBuf("def"), TStringBuf("xxxxxx")};
+ const TStringBuf tokens[] = {TStringBuf(), TStringBuf("def"), TStringBuf("xxxxxx")};
const auto tokensSize = Y_ARRAY_SIZE(tokens);
auto&& input = TMemoryInput{data, dataSize};
auto&& tokenizer = TStreamTokenizer<TEol>{&input};
@@ -91,7 +91,7 @@ Y_UNIT_TEST_SUITE(TStreamTokenizerTests) {
Y_UNIT_TEST(SimpleTest) {
const char data[] = "qwerty\n1234567890\n";
const auto dataSize = Y_ARRAY_SIZE(data) - 1;
- const TStringBuf tokens[] = {TStringBuf("qwerty"), TStringBuf("1234567890")};
+ const TStringBuf tokens[] = {TStringBuf("qwerty"), TStringBuf("1234567890")};
const auto tokensSize = Y_ARRAY_SIZE(tokens);
auto&& input = TMemoryInput{data, dataSize};
auto&& tokenizer = TStreamTokenizer<TEol>{&input};
@@ -115,7 +115,7 @@ Y_UNIT_TEST_SUITE(TStreamTokenizerTests) {
const char data[] = "abc|def|xxxxxx";
const auto dataSize = Y_ARRAY_SIZE(data) - 1;
- const TStringBuf tokens[] = {TStringBuf("abc"), TStringBuf("def"), TStringBuf("xxxxxx")};
+ const TStringBuf tokens[] = {TStringBuf("abc"), TStringBuf("def"), TStringBuf("xxxxxx")};
const auto tokensSize = Y_ARRAY_SIZE(tokens);
auto&& input = TMemoryInput{data, dataSize};
auto&& tokenizer = TStreamTokenizer<TIsVerticalBar>{&input};
@@ -139,8 +139,8 @@ Y_UNIT_TEST_SUITE(TStreamTokenizerTests) {
const char data[] = "abc|def|xxxxxx,abc|def|xxxxxx";
const auto dataSize = Y_ARRAY_SIZE(data) - 1;
- const TStringBuf tokens[] = {TStringBuf("abc"), TStringBuf("def"), TStringBuf("xxxxxx"),
- TStringBuf("abc"), TStringBuf("def"), TStringBuf("xxxxxx")};
+ const TStringBuf tokens[] = {TStringBuf("abc"), TStringBuf("def"), TStringBuf("xxxxxx"),
+ TStringBuf("abc"), TStringBuf("def"), TStringBuf("xxxxxx")};
const auto tokensSize = Y_ARRAY_SIZE(tokens);
auto&& input = TMemoryInput{data, dataSize};
auto&& tokenizer = TStreamTokenizer<TIsVerticalBar>{&input};
@@ -199,7 +199,7 @@ Y_UNIT_TEST_SUITE(TStreamTokenizerTests) {
Y_UNIT_TEST(FirstTokenHasSizeOfTheBufferTest) {
const char data[] = "xxxxx\nxx";
const auto dataSize = Y_ARRAY_SIZE(data) - 1;
- const TStringBuf tokens[] = {TStringBuf("xxxxx"), TStringBuf("xx")};
+ const TStringBuf tokens[] = {TStringBuf("xxxxx"), TStringBuf("xx")};
const auto tokensSize = Y_ARRAY_SIZE(tokens);
auto&& input = TMemoryInput{data, dataSize};
auto&& tokenizer = TStreamTokenizer<TEol>{&input, TEol{}, tokens[0].size()};
@@ -231,7 +231,7 @@ Y_UNIT_TEST_SUITE(TStreamTokenizerTests) {
Y_UNIT_TEST(BufferSizeInitialSizeSmallerThanTokenTest) {
const char data[] = "xxxxx\nxx";
const auto dataSize = Y_ARRAY_SIZE(data) - 1;
- const TStringBuf tokens[] = {TStringBuf("xxxxx"), TStringBuf("xx")};
+ const TStringBuf tokens[] = {TStringBuf("xxxxx"), TStringBuf("xx")};
const auto tokensSize = Y_ARRAY_SIZE(tokens);
auto&& input = TMemoryInput{data, dataSize};
auto&& tokenizer = TStreamTokenizer<TEol>{&input, TEol{}, 1};
@@ -248,7 +248,7 @@ Y_UNIT_TEST_SUITE(TStreamTokenizerTests) {
Y_UNIT_TEST(RangeBasedForTest) {
const char data[] = "abc\ndef\nxxxxxx";
const auto dataSize = Y_ARRAY_SIZE(data) - 1;
- const TStringBuf tokens[] = {TStringBuf("abc"), TStringBuf("def"), TStringBuf("xxxxxx")};
+ const TStringBuf tokens[] = {TStringBuf("abc"), TStringBuf("def"), TStringBuf("xxxxxx")};
const auto tokensSize = Y_ARRAY_SIZE(tokens);
auto&& input = TMemoryInput{data, dataSize};
auto&& tokenizer = TStreamTokenizer<TEol>{&input};
diff --git a/util/stream/zlib_ut.cpp b/util/stream/zlib_ut.cpp
index 2290b4a9de..4ccd2c72ca 100644
--- a/util/stream/zlib_ut.cpp
+++ b/util/stream/zlib_ut.cpp
@@ -76,8 +76,8 @@ Y_UNIT_TEST_SUITE(TZLibTest) {
}
Y_UNIT_TEST(Dictionary) {
- static constexpr TStringBuf data = "<html><body></body></html>";
- static constexpr TStringBuf dict = "</<html><body>";
+ static constexpr TStringBuf data = "<html><body></body></html>";
+ static constexpr TStringBuf dict = "</<html><body>";
for (auto type : {ZLib::Raw, ZLib::ZLib}) {
TStringStream compressed;
{