MCPcopy Create free account
hub / github.com/catboost/catboost / DoSplit0

Function DoSplit0

util/string/vector.cpp:24–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23template <class C, class TDelim, typename TChr>
24static inline void DoSplit0(C* res, const TBasicStringBuf<TChr> str, TDelim& d, size_t maxFields, int options) {
25 using TStringType = std::conditional_t<std::is_same<TChr, wchar16>::value, TUtf16String, TString>;
26 res->clear();
27
28 if (!str.data()) {
29 return;
30 }
31
32 using TConsumer = TContainerConsumer<C>;
33 TConsumer cc(res);
34
35 if (maxFields) {
36 TLimitingConsumer<TConsumer, const TChr> lc(maxFields, &cc);
37
38 DoSplit1(lc, d, str, options);
39
40 if (lc.Last) {
41 res->push_back(TStringType(lc.Last, str.data() + str.size() - lc.Last));
42 }
43 } else {
44 DoSplit1(cc, d, str, options);
45 }
46}
47
48template <typename TChr>
49static void SplitStringImplT(TVector<std::conditional_t<std::is_same<TChr, wchar16>::value, TUtf16String, TString>>* res,

Callers 1

SplitStringImplTFunction · 0.85

Calls 5

DoSplit1Function · 0.85
clearMethod · 0.45
dataMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected