diff --git a/src/utils.h b/src/utils.h index d5fc55be..e02e18c6 100644 --- a/src/utils.h +++ b/src/utils.h @@ -49,12 +49,14 @@ std::vector SplitString(const std::string& str, std::string LowerPathIfCaseInsensitive(const std::string& path); template -std::string StringJoinMap(const TValues& values, const TMap& map) { +std::string StringJoinMap(const TValues& values, + const TMap& map, + const std::string& sep = ", ") { std::string result; bool first = true; for (auto& entry : values) { if (!first) - result += ", "; + result += sep; first = false; result += map(entry); } @@ -62,8 +64,9 @@ std::string StringJoinMap(const TValues& values, const TMap& map) { } template -std::string StringJoin(const TValues& values) { - return StringJoinMap(values, [](const std::string& entry) { return entry; }); +std::string StringJoin(const TValues& values, const std::string& sep = ", ") { + return StringJoinMap(values, [](const std::string& entry) { return entry; }, + sep); } template