MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / splitPossibleUnbracedList

Function splitPossibleUnbracedList

src/function/cast_from_string_functions.cpp:352–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350
351template<typename T>
352static bool splitPossibleUnbracedList(std::string_view input, T& state, const CSVOption* option) {
353 input = StringUtils::ltrim(StringUtils::rtrim(input));
354 auto split = StringUtils::smartSplit(input, ';');
355 if (split.size() == 1 && input.front() == '[' && input.back() == ']') {
356 split = StringUtils::smartSplit(input.substr(1, input.size() - 2), ';');
357 }
358 for (auto& i : split) {
359 state.handleValue(i.data(), i.data() + i.length(), option);
360 }
361 return true;
362}
363
364template<typename T>
365static inline void startListCast(const char* input, uint64_t len, T split, const CSVOption* option,

Callers 2

startListCastFunction · 0.85
castMethod · 0.85

Calls 6

ltrimFunction · 0.85
rtrimFunction · 0.85
lengthMethod · 0.80
sizeMethod · 0.45
handleValueMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected