add char** overloads for join_string
[libi2ncommon] / src / stringfunc.cpp
index 3c8ce1a..72de728 100644 (file)
@@ -479,6 +479,30 @@ std::string join_string(
    return result;
 } // eo join_string(const std::vector< std::string >&,const std::string&)
 
+std::string join_string (
+   const char *const parts[], /* assumed NULL-terminated */
+   const std::string& delimiter
+)
+{
+   std::string result;
+
+   if (parts != NULL)
+   {
+       const char *const *cur = parts;
+
+       if (*cur != NULL) {
+           result = std::string (*cur);
+
+           while (*++cur != NULL) {
+               result += delimiter;
+               result += std::string (*cur);
+           }
+       }
+   }
+
+   return result;
+}
+
 
 
 /*