aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/deprecated/split/delim_string_iter.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/deprecated/split/delim_string_iter.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/deprecated/split/delim_string_iter.h')
-rw-r--r--library/cpp/deprecated/split/delim_string_iter.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/deprecated/split/delim_string_iter.h b/library/cpp/deprecated/split/delim_string_iter.h
index 8e4ca171a0..9ef4bada93 100644
--- a/library/cpp/deprecated/split/delim_string_iter.h
+++ b/library/cpp/deprecated/split/delim_string_iter.h
@@ -3,10 +3,10 @@
#include <util/generic/algorithm.h>
#include <util/generic/strbuf.h>
#include <util/generic/yexception.h>
-#include <util/string/cast.h>
-#include <util/system/yassert.h>
+#include <util/string/cast.h>
+#include <util/system/yassert.h>
-#include <iterator>
+#include <iterator>
class TDelimStringIter {
public:
@@ -18,8 +18,8 @@ public:
inline TDelimStringIter(const char* begin, const char* strEnd, TStringBuf delim)
: TDelimStringIter(TStringBuf(begin, strEnd), delim)
- {
- }
+ {
+ }
inline TDelimStringIter(TStringBuf str, TStringBuf delim)
: IsValid(true)
@@ -31,10 +31,10 @@ public:
inline TDelimStringIter()
: IsValid(false)
- {
- }
+ {
+ }
- inline explicit operator bool() const {
+ inline explicit operator bool() const {
return IsValid;
}
@@ -52,7 +52,7 @@ public:
}
inline void operator+=(size_t n) {
- for (; n > 0; --n) {
+ for (; n > 0; --n) {
++(*this);
}
}
@@ -74,7 +74,7 @@ public:
}
// Get & advance
- template <class T>
+ template <class T>
inline bool TryNext(T& t) {
if (IsValid) {
t = FromString<T>(Current);
@@ -85,7 +85,7 @@ public:
}
}
- template <class T>
+ template <class T>
inline TDelimStringIter& Next(T& t) // Get & advance
{
if (!TryNext(t))
@@ -93,7 +93,7 @@ public:
return *this;
}
- template <class T>
+ template <class T>
inline T GetNext() {
T res;
Next(res);
@@ -124,7 +124,7 @@ public:
private:
inline void UpdateCurrent() {
// it is much faster than TStringBuf::find
- size_t pos = std::search(Str.begin(), Str.end(), Delim.begin(), Delim.end()) - Str.begin();
+ size_t pos = std::search(Str.begin(), Str.end(), Delim.begin(), Delim.end()) - Str.begin();
Current = Str.Head(pos);
}
@@ -137,15 +137,15 @@ private:
};
//example: for (TStringBuf field: TDelimStroka(line, "@@")) { ... }
-struct TDelimStroka {
+struct TDelimStroka {
TStringBuf S;
TStringBuf Delim;
inline TDelimStroka(TStringBuf s, TStringBuf delim)
: S(s)
, Delim(delim)
- {
- }
+ {
+ }
inline TDelimStringIter begin() const {
return TDelimStringIter(S, Delim);