X-Git-Url: http://developer.intra2net.com/git/?a=blobdiff_plain;f=src%2Fstringfunc.cpp;h=72de728a17963ab9c39d056f4db1cc5da5383445;hb=4f7a7b9fb013e4c5ed68013cb44df16ed72817c5;hp=3c8ce1a3135c526da4c1bb2343ca3709fb87a4d2;hpb=16d42e06a948baedc7b64502a7b2e05fd1f918c0;p=libi2ncommon diff --git a/src/stringfunc.cpp b/src/stringfunc.cpp index 3c8ce1a..72de728 100644 --- a/src/stringfunc.cpp +++ b/src/stringfunc.cpp @@ -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; +} + /*