MCPcopy Create free account
hub / github.com/apache/brpc / JoinStringT

Function JoinStringT

src/butil/strings/string_util.cc:605–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603
604template<typename STR>
605static STR JoinStringT(const std::vector<STR>& parts, const STR& sep) {
606 if (parts.empty())
607 return STR();
608
609 STR result(parts[0]);
610 typename std::vector<STR>::const_iterator iter = parts.begin();
611 ++iter;
612
613 for (; iter != parts.end(); ++iter) {
614 result += sep;
615 result += *iter;
616 }
617
618 return result;
619}
620
621std::string JoinString(const std::vector<std::string>& parts, char sep) {
622 return JoinStringT(parts, std::string(1, sep));

Callers 1

JoinStringFunction · 0.85

Calls 3

emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected