MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / split

Function split

TactilityCore/Source/StringUtils.cpp:32–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void split(const std::string& input, const std::string& delimiter, std::function<void(const std::string&)> callback) {
33 size_t token_index = 0;
34 size_t delimiter_index;
35 const size_t delimiter_length = delimiter.length();
36
37 while ((delimiter_index = input.find(delimiter, token_index)) != std::string::npos) {
38 std::string token = input.substr(token_index, delimiter_index - token_index);
39 token_index = delimiter_index + delimiter_length;
40 callback(token);
41 }
42
43 auto end_token = input.substr(token_index);
44 if (!end_token.empty()) {
45 callback(end_token);
46 }
47}
48
49std::vector<std::string> split(const std::string&input, const std::string&delimiter) {
50 std::vector<std::string> result;

Callers 8

StringTest.cppFile · 0.85
parseContentDispositionFunction · 0.85
handleAppInstallMethod · 0.85
handleApiAppsInstallMethod · 0.85
renderCurrentMethod · 0.85
fromBundleFunction · 0.85
onShowMethod · 0.85
onShowMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected