| 55 | } |
| 56 | |
| 57 | std::string join(const std::vector<const char*>& input, const std::string& delimiter) { |
| 58 | std::stringstream stream; |
| 59 | size_t size = input.size(); |
| 60 | |
| 61 | if (size == 0) { |
| 62 | return ""; |
| 63 | } else if (size == 1) { |
| 64 | return input.front(); |
| 65 | } else { |
| 66 | auto iterator = input.begin(); |
| 67 | while (iterator != input.end()) { |
| 68 | stream << *iterator; |
| 69 | iterator++; |
| 70 | if (iterator != input.end()) { |
| 71 | stream << delimiter; |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | return stream.str(); |
| 77 | } |
| 78 | |
| 79 | std::string join(const std::vector<std::string>& input, const std::string& delimiter) { |
| 80 | std::stringstream stream; |
no outgoing calls
no test coverage detected