diff options
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index cf8feb970..da0121eca 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -27,6 +27,7 @@ #include <locale> #include <sstream> #include <string> +#include <sstream> #include <vector> #include <stddef.h> @@ -85,6 +86,17 @@ bool Startswith(const std::string &s, const std::string &start) return (s.compare(0, start.size(), start) == 0); } +std::string Join(std::vector<std::string> list, const std::string &sep) +{ + std::ostringstream oss; + for (auto it = list.begin(); it != list.end(); it++) + { + if (it != list.begin()) oss << sep; + oss << *it; + } + return oss.str(); +} + } } /*}}}*/ |