diff options
author | yuliy <yuliy@yandex-team.ru> | 2022-02-10 16:50:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:10 +0300 |
commit | 9991a6195dee8db26aa7e2f5f21549fb20e25002 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/deprecated/split/delim_string_iter.cpp | |
parent | df5f2b17d65c239ec8d68fdf518fcbea2bcc0bfe (diff) | |
download | ydb-9991a6195dee8db26aa7e2f5f21549fb20e25002.tar.gz |
Restoring authorship annotation for <yuliy@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/deprecated/split/delim_string_iter.cpp')
-rw-r--r-- | library/cpp/deprecated/split/delim_string_iter.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/library/cpp/deprecated/split/delim_string_iter.cpp b/library/cpp/deprecated/split/delim_string_iter.cpp index 8470a8587b..af418c5bfb 100644 --- a/library/cpp/deprecated/split/delim_string_iter.cpp +++ b/library/cpp/deprecated/split/delim_string_iter.cpp @@ -1,45 +1,45 @@ #include "delim_string_iter.h" - -// + +// // TKeyValueDelimStringIter -// - +// + void TKeyValueDelimStringIter::ReadKeyAndValue() { - TStringBuf currentToken(*DelimIter); - - size_t pos = currentToken.find('='); + TStringBuf currentToken(*DelimIter); + + size_t pos = currentToken.find('='); if (pos == TString::npos) { - ChunkValue.Clear(); - ChunkKey = currentToken; - } else { - ChunkKey = currentToken.SubStr(0, pos); - ChunkValue = currentToken.SubStr(pos + 1); - } -} - + ChunkValue.Clear(); + ChunkKey = currentToken; + } else { + ChunkKey = currentToken.SubStr(0, pos); + ChunkValue = currentToken.SubStr(pos + 1); + } +} + TKeyValueDelimStringIter::TKeyValueDelimStringIter(const TStringBuf str, const TStringBuf delim) - : DelimIter(str, delim) -{ - if (DelimIter.Valid()) - ReadKeyAndValue(); -} - + : DelimIter(str, delim) +{ + if (DelimIter.Valid()) + ReadKeyAndValue(); +} + bool TKeyValueDelimStringIter::Valid() const { - return DelimIter.Valid(); -} - + return DelimIter.Valid(); +} + TKeyValueDelimStringIter& TKeyValueDelimStringIter::operator++() { - ++DelimIter; - if (DelimIter.Valid()) - ReadKeyAndValue(); - - return *this; -} - + ++DelimIter; + if (DelimIter.Valid()) + ReadKeyAndValue(); + + return *this; +} + const TStringBuf& TKeyValueDelimStringIter::Key() const { - return ChunkKey; -} - + return ChunkKey; +} + const TStringBuf& TKeyValueDelimStringIter::Value() const { - return ChunkValue; -} + return ChunkValue; +} |