MCPcopy Create free account
hub / github.com/ceph/ceph / str_join

Function str_join

src/include/str_list.h:83–94  ·  view source on GitHub ↗

* Return a String containing the vector **v** joined with **sep** * * If **v** is empty, the function returns an empty string * For each element in **v**, * it will concatenate this element and **sep** with result * * @param [in] v Vector to join as a String * @param [in] sep String used to join each element from **v** * @return empty string if **v** is empty or concatenated string **/

Source from the content-addressed store, hash-verified

81 * @return empty string if **v** is empty or concatenated string
82**/
83inline std::string str_join(const std::vector<std::string>& v, const std::string& sep)
84{
85 if (v.empty())
86 return std::string();
87 auto i = v.cbegin();
88 std::string r = *i;
89 for (++i; i != v.cend(); ++i) {
90 r += sep;
91 r += *i;
92 }
93 return r;
94}
95
96#endif

Callers 3

_do_commandMethod · 0.50
handle_commandMethod · 0.50
prepare_commandMethod · 0.50

Calls 3

emptyMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45

Tested by

no test coverage detected