MCPcopy Index your code
hub / github.com/Kitware/CMake / cmJoin

Function cmJoin

Source/cmStringAlgorithms.h:69–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67/** Joins elements of a range with separator into a single string. */
68template <typename Range>
69std::string cmJoin(Range const& rng, cm::string_view separator)
70{
71 if (rng.empty()) {
72 return std::string();
73 }
74
75 std::ostringstream os;
76 auto it = rng.begin();
77 auto const end = rng.end();
78 os << *it;
79 while (++it != end) {
80 os << separator << *it;
81 }
82 return os.str();
83}
84
85/** Generic function to join strings range with separator
86 * and initial leading string into a single string.

Callers 15

HandleTransformCommandFunction · 0.70
EnableLanguageMethod · 0.70
MaybeReportErrorMethod · 0.70
CreateXCodeObjectsMethod · 0.70
MessageHeaderMethod · 0.70
WriteDeviceLinkRuleMethod · 0.70
PrintableMethod · 0.70
AppendCleanCommandMethod · 0.70

Calls 4

strMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 3

SetArgsFromPresetMethod · 0.56
testStringAlgorithmsFunction · 0.40
LogFailedTestsMethod · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…