diff options
author | mvel <mvel@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
commit | bd30392c4cc92487950adc375c07adf52da1d592 (patch) | |
tree | e8d1a3f19b7fc890bcef6e4cc5de41f1d88c9ac3 /util/stream | |
parent | 5d50718e66d9c037dc587a0211110b7d25a66185 (diff) | |
download | ydb-bd30392c4cc92487950adc375c07adf52da1d592.tar.gz |
Restoring authorship annotation for <mvel@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/stream')
-rw-r--r-- | util/stream/ios_ut.cpp | 30 | ||||
-rw-r--r-- | util/stream/str.h | 14 | ||||
-rw-r--r-- | util/stream/zlib.h | 4 |
3 files changed, 24 insertions, 24 deletions
diff --git a/util/stream/ios_ut.cpp b/util/stream/ios_ut.cpp index 139f4296e5..ada45c76e7 100644 --- a/util/stream/ios_ut.cpp +++ b/util/stream/ios_ut.cpp @@ -52,7 +52,7 @@ public: UNIT_TEST_SUITE_REGISTRATION(TStreamsTest); -void TStreamsTest::TestIStreamOperators() { +void TStreamsTest::TestIStreamOperators() { TString data("first line\r\nsecond\t\xd1\x82\xd0\xb5\xd1\x81\xd1\x82 line\r\n 1 -4 59 4320000000009999999 c\n -1.5 1e-110"); TStringInput si(data); @@ -103,20 +103,20 @@ void TStreamsTest::TestStringStream() { UNIT_ASSERT_EQUAL(s.ReadLine(), "123.1"); UNIT_ASSERT_EQUAL(s.Str(), "qw\r\n1234\n34\r\n123.1"); - - // Test stream copying - TStringStream sc = s; - - s << "-666-" << 13; - sc << "-777-" << 0 << "JackPot"; - - UNIT_ASSERT_EQUAL(s.Str(), "qw\r\n1234\n34\r\n123.1-666-13"); - UNIT_ASSERT_EQUAL(sc.Str(), "qw\r\n1234\n34\r\n123.1-777-0JackPot"); - - TStringStream ss; - ss = s; - s << "... and some trash"; - UNIT_ASSERT_EQUAL(ss.Str(), "qw\r\n1234\n34\r\n123.1-666-13"); + + // Test stream copying + TStringStream sc = s; + + s << "-666-" << 13; + sc << "-777-" << 0 << "JackPot"; + + UNIT_ASSERT_EQUAL(s.Str(), "qw\r\n1234\n34\r\n123.1-666-13"); + UNIT_ASSERT_EQUAL(sc.Str(), "qw\r\n1234\n34\r\n123.1-777-0JackPot"); + + TStringStream ss; + ss = s; + s << "... and some trash"; + UNIT_ASSERT_EQUAL(ss.Str(), "qw\r\n1234\n34\r\n123.1-666-13"); } void TStreamsTest::TestGenericRead() { diff --git a/util/stream/str.h b/util/stream/str.h index 028bd572c0..19bbc4643b 100644 --- a/util/stream/str.h +++ b/util/stream/str.h @@ -4,10 +4,10 @@ #include "zerocopy_output.h" #include <util/generic/string.h> -#include <util/generic/noncopyable.h> +#include <util/generic/noncopyable.h> #include <util/generic/store_policy.h> -/** +/** * @addtogroup Streams_Strings * @{ */ @@ -54,11 +54,11 @@ protected: private: const TString* S_; size_t Pos_; - - friend class TStringStream; + + friend class TStringStream; }; -/** +/** * Stream for writing data into a string. */ class TStringOutput: public IZeroCopyOutput { @@ -131,7 +131,7 @@ public: , TStringOutput(*TEmbeddedString::Ptr()) { } - + inline TStringStream& operator=(const TStringStream& other) { // All references remain alive, we need to change position only Str() = other.Str(); @@ -139,7 +139,7 @@ public: return *this; } - + ~TStringStream() override; /** diff --git a/util/stream/zlib.h b/util/stream/zlib.h index e7de7c81b7..0961de7d4b 100644 --- a/util/stream/zlib.h +++ b/util/stream/zlib.h @@ -37,9 +37,9 @@ namespace ZLib { }; } -/** +/** * Non-buffered ZLib decompressing stream. - * + * * Please don't use `TZLibDecompress` if you read text data from stream using * `ReadLine`, it is VERY slow (approx 10 times slower, according to synthetic * benchmark). For fast buffered ZLib stream reading use `TBufferedZLibDecompress` |