MCPcopy Create free account
hub / github.com/p-ranav/tabulate / split_lines

Method split_lines

include/tabulate/format.hpp:427–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425 }
426
427 static std::vector<std::string> split_lines(const std::string &text, const std::string &delimiter,
428 const std::string &locale,
429 bool is_multi_byte_character_support_enabled) {
430 std::vector<std::string> result{};
431 std::string input = text;
432 size_t pos = 0;
433 std::string token;
434 while ((pos = input.find(delimiter)) != std::string::npos) {
435 token = input.substr(0, pos);
436 result.push_back(token);
437 input.erase(0, pos + delimiter.length());
438 }
439 if (get_sequence_length(input, locale, is_multi_byte_character_support_enabled))
440 result.push_back(input);
441 return result;
442 };
443
444 // Merge two formats
445 // first has higher precedence

Callers

nothing calls this directly

Calls 3

get_sequence_lengthFunction · 0.70
findMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected