diff --git a/include/linphone/utils/utils.h b/include/linphone/utils/utils.h index e13c89889..0714e9a06 100644 --- a/include/linphone/utils/utils.h +++ b/include/linphone/utils/utils.h @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -107,6 +108,15 @@ namespace Utils { return str ? str : ""; } + template + LINPHONE_PUBLIC std::string join (const std::vector& elems, const S& delim) { + std::stringstream ss; + auto e = elems.begin(); + ss << *e++; + for (; e != elems.end(); ++e) + ss << delim << *e; + return ss.str(); + } LINPHONE_PUBLIC std::string trim (const std::string &str); template