MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / split

Function split

library/strings.cpp:83–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83std::vector<UString> split(const UStringView str, const UStringView delims)
84{
85 // FIXME: Probably won't work if any of 'delims' is outside the ASCII range
86 std::vector<UString> strings;
87 size_t pos = 0;
88 size_t prev = pos;
89 while ((pos = str.find_first_of(delims, prev)) != std::string::npos)
90 {
91 if (pos > prev)
92 strings.push_back(UString(str.substr(prev, pos - prev)));
93 prev = pos + 1;
94 }
95 strings.push_back(UString(str.substr(prev, pos)));
96 return strings;
97}
98
99UString insert_codepoints(const UStringView str, size_t offset, const UStringView insert)
100{

Callers 15

initMethod · 0.85
loadModsMethod · 0.85
setupModListMethod · 0.85
mainFunction · 0.85
saveMethod · 0.85
loadVoxelSliceMethod · 0.85
loadImageSetMethod · 0.85
loadImageMethod · 0.85
loadVideoMethod · 0.85
wordWrapTextMethod · 0.85
displayInitialiseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected