aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/split.h
diff options
context:
space:
mode:
authorfippo <fippo@yandex-team.ru>2022-02-10 16:50:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:08 +0300
commit7bf72dabd2102d9781c1ec7a754579757baa7b90 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util/string/split.h
parent3e57c324d47a3a202cb3c5a9648d2f92103d5213 (diff)
downloadydb-7bf72dabd2102d9781c1ec7a754579757baa7b90.tar.gz
Restoring authorship annotation for <fippo@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string/split.h')
-rw-r--r--util/string/split.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/util/string/split.h b/util/string/split.h
index 3d7c6d1a95..bc46d9e64c 100644
--- a/util/string/split.h
+++ b/util/string/split.h
@@ -423,14 +423,14 @@ inline size_t Split(const TStringBuf s, const TSetDelimiter<const char>& delim,
SplitString(s.data(), s.data() + s.size(), delim, consumer);
return res.size();
}
-
+
template <class P, class D>
-void GetNext(TStringBuf& s, D delim, P& param) {
- TStringBuf next = s.NextTok(delim);
+void GetNext(TStringBuf& s, D delim, P& param) {
+ TStringBuf next = s.NextTok(delim);
Y_ENSURE(next.IsInited(), TStringBuf("Split: number of fields less than number of Split output arguments"));
- param = FromString<P>(next);
-}
-
+ param = FromString<P>(next);
+}
+
template <class P, class D>
void GetNext(TStringBuf& s, D delim, TMaybe<P>& param) {
TStringBuf next = s.NextTok(delim);
@@ -444,17 +444,17 @@ void GetNext(TStringBuf& s, D delim, TMaybe<P>& param) {
// example:
// Split(TStringBuf("Sherlock,2014,36.6"), ',', name, year, temperature);
template <class D, class P1, class P2>
-void Split(TStringBuf s, D delim, P1& p1, P2& p2) {
- GetNext(s, delim, p1);
- GetNext(s, delim, p2);
+void Split(TStringBuf s, D delim, P1& p1, P2& p2) {
+ GetNext(s, delim, p1);
+ GetNext(s, delim, p2);
Y_ENSURE(!s.IsInited(), TStringBuf("Split: number of fields more than number of Split output arguments"));
-}
-
+}
+
template <class D, class P1, class P2, class... Other>
void Split(TStringBuf s, D delim, P1& p1, P2& p2, Other&... other) {
- GetNext(s, delim, p1);
+ GetNext(s, delim, p1);
Split(s, delim, p2, other...);
-}
+}
/**
* \fn auto StringSplitter(...)