|
@@ -12,7 +12,7 @@ static inline void DoSplit2(TConsumer& c, TDelim& d, const TBasicStringBuf<TChr>
|
|
|
template <class TConsumer, class TDelim, typename TChr>
|
|
|
static inline void DoSplit1(TConsumer& cc, TDelim& d, const TBasicStringBuf<TChr> str, int opts) {
|
|
|
if (opts & KEEP_EMPTY_TOKENS) {
|
|
|
- DoSplit2(cc, d, str, opts);
|
|
|
+ DoSplit2(cc, d, str, opts);
|
|
|
} else {
|
|
|
TSkipEmptyTokens<TConsumer> sc(&cc);
|
|
|
|
|
@@ -35,13 +35,13 @@ static inline void DoSplit0(C* res, const TBasicStringBuf<TChr> str, TDelim& d,
|
|
|
if (maxFields) {
|
|
|
TLimitingConsumer<TConsumer, const TChr> lc(maxFields, &cc);
|
|
|
|
|
|
- DoSplit1(lc, d, str, options);
|
|
|
+ DoSplit1(lc, d, str, options);
|
|
|
|
|
|
if (lc.Last) {
|
|
|
res->push_back(TStringType(lc.Last, str.data() + str.size() - lc.Last));
|
|
|
}
|
|
|
} else {
|
|
|
- DoSplit1(cc, d, str, options);
|
|
|
+ DoSplit1(cc, d, str, options);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -55,11 +55,11 @@ static void SplitStringImplT(TVector<std::conditional_t<std::is_same<TChr, wchar
|
|
|
if (*(delim + 1)) {
|
|
|
TStringDelimiter<const TChr> d(delim, std::char_traits<TChr>::length(delim));
|
|
|
|
|
|
- DoSplit0(res, str, d, maxFields, options);
|
|
|
+ DoSplit0(res, str, d, maxFields, options);
|
|
|
} else {
|
|
|
TCharDelimiter<const TChr> d(*delim);
|
|
|
|
|
|
- DoSplit0(res, str, d, maxFields, options);
|
|
|
+ DoSplit0(res, str, d, maxFields, options);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -69,16 +69,16 @@ void ::NPrivate::SplitStringImpl(TVector<TString>* res, const char* ptr, const c
|
|
|
|
|
|
void ::NPrivate::SplitStringImpl(TVector<TString>* res, const char* ptr, size_t len, const char* delim, size_t maxFields, int options) {
|
|
|
return SplitStringImplT<char>(res, TStringBuf(ptr, len), delim, maxFields, options);
|
|
|
-}
|
|
|
-
|
|
|
+}
|
|
|
+
|
|
|
void ::NPrivate::SplitStringImpl(TVector<TUtf16String>* res, const wchar16* ptr, const wchar16* delimiter, size_t maxFields, int options) {
|
|
|
return SplitStringImplT<wchar16>(res, TWtringBuf(ptr), delimiter, maxFields, options);
|
|
|
}
|
|
|
|
|
|
void ::NPrivate::SplitStringImpl(TVector<TUtf16String>* res, const wchar16* ptr, size_t len, const wchar16* delimiter, size_t maxFields, int options) {
|
|
|
return SplitStringImplT<wchar16>(res, TWtringBuf(ptr, len), delimiter, maxFields, options);
|
|
|
-}
|
|
|
-
|
|
|
+}
|
|
|
+
|
|
|
TUtf16String JoinStrings(const TVector<TUtf16String>& v, const TWtringBuf delim) {
|
|
|
return JoinStrings(v.begin(), v.end(), delim);
|
|
|
}
|