* Joins a std::string vector in to a std::string with a separator. */
| 328 | * Joins a std::string vector in to a std::string with a separator. |
| 329 | */ |
| 330 | static std::string Join(const std::vector<std::string>& strings, |
| 331 | const std::string& separator) { |
| 332 | std::ostringstream buffer; |
| 333 | bool first = true; |
| 334 | for (const auto& str : strings) { |
| 335 | if (!first) { |
| 336 | buffer << separator; |
| 337 | } |
| 338 | buffer << str; |
| 339 | first = false; |
| 340 | } |
| 341 | return buffer.str(); |
| 342 | } |
| 343 | |
| 344 | /** |
| 345 | * Joins a std::string vector in to a std::string. |