| 603 | |
| 604 | template<typename STR> |
| 605 | static 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 | |
| 621 | std::string JoinString(const std::vector<std::string>& parts, char sep) { |
| 622 | return JoinStringT(parts, std::string(1, sep)); |
no test coverage detected