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

Function Join

src/utils/StringUtils.h:194–211  ·  view source on GitHub ↗

Join a list of strings using an arbitrary separator.

Source from the content-addressed store, hash-verified

192
193// Join a list of strings using an arbitrary separator.
194inline std::string Join(const StringVec & strings, char separator)
195{
196 if (strings.empty()) return "";
197
198 const StringVec::size_type len = strings.size();
199
200 if (len==1) return strings[0];
201
202 const std::string sep(1, separator);
203
204 std::string result{strings[0]};
205 for (StringVec::size_type i=1; i<len; ++i)
206 {
207 result += sep + " " + strings[i];
208 }
209
210 return result;
211}
212
213// Split a string content by line feeds.
214inline StringVec SplitByLines(const std::string & str)

Callers 11

ColorSpace.cppFile · 0.85
NamedTransform.cppFile · 0.85
AddActiveDisplayViewFunction · 0.85
RemoveActiveDisplayViewFunction · 0.85
processActiveListsMethod · 0.85
handleRemoveMethod · 0.85
cleanUpInactiveListFunction · 0.85
handlePreferInputMethod · 0.85
handlePreferBaseMethod · 0.85
loadOverridesMethod · 0.85
OCIO_ADD_TESTFunction · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by 1

OCIO_ADD_TESTFunction · 0.68