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

Method split

src/common/string_utils.cpp:86–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86std::vector<std::string> StringUtils::split(const std::string& input, const std::string& delimiter,
87 bool ignoreEmptyStringParts) {
88 auto result = std::vector<std::string>();
89 auto prevPos = 0u;
90 auto currentPos = findDelim(input, delimiter, prevPos);
91 while (currentPos != std::string::npos) {
92 auto stringPart = input.substr(prevPos, currentPos - prevPos);
93 if (!ignoreEmptyStringParts || !stringPart.empty()) {
94 result.push_back(input.substr(prevPos, currentPos - prevPos));
95 }
96 prevPos = currentPos + delimiter.size();
97 currentPos = findDelim(input, delimiter, prevPos);
98 }
99 result.push_back(input.substr(prevPos));
100 return result;
101}
102
103std::vector<std::string> StringUtils::splitBySpace(const std::string& input) {
104 std::istringstream iss(input);

Callers 15

_get_lbug_versionFunction · 0.45
scalar_listFunction · 0.45
send_fileMethod · 0.45
find_valid_dataset_dirsFunction · 0.45
parse_metadata_mapFunction · 0.45
lbug_version_comparisonFunction · 0.45
build_graphFunction · 0.45
mainFunction · 0.45
read_base_versionFunction · 0.45
get_versionFunction · 0.45
get_machine_architectureFunction · 0.45
_get_lbug_versionFunction · 0.45

Calls 4

findDelimFunction · 0.85
emptyMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by 3

_get_lbug_versionFunction · 0.36
get_versionFunction · 0.36
get_machine_architectureFunction · 0.36