MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / Split

Function Split

src/utils/StringUtils.h:172–191  ·  view source on GitHub ↗

Split a string content using an arbitrary separator.

Source from the content-addressed store, hash-verified

170
171// Split a string content using an arbitrary separator.
172inline StringVec Split(const std::string & str, char separator)
173{
174 if (str.empty()) return {""};
175
176 StringVec results;
177
178 std::stringstream ss(str);
179 std::string item;
180 while (std::getline(ss, item, separator))
181 {
182 results.push_back(std::move(item));
183 }
184
185 if (EndsWith(str, std::string(1, separator)))
186 {
187 results.push_back("");
188 }
189
190 return results;
191}
192
193// Join a list of strings using an arbitrary separator.
194inline std::string Join(const StringVec & strings, char separator)

Callers 15

loadFunction · 0.85
LookParse.cppFile · 0.85
setSearchPathMethod · 0.85
ColorSpaceInfoMethod · 0.85
AddActiveDisplayViewFunction · 0.85
RemoveActiveDisplayViewFunction · 0.85
ExtractItemsFunction · 0.85
setSearchPathMethod · 0.85
splitActiveListFunction · 0.85
loadMethod · 0.85
OCIO_ADD_TESTFunction · 0.85

Calls 3

EndsWithFunction · 0.85
emptyMethod · 0.45
push_backMethod · 0.45

Tested by 4

OCIO_ADD_TESTFunction · 0.68
mainFunction · 0.68
UnitTestMainFunction · 0.68
mainFunction · 0.68