1 # pragma once 2 3 # include "astroid.hh" 4 # include <vector> 5 6 namespace Astroid { has(std::vector<T> v,T e)7 template<class T> bool has (std::vector<T> v, T e) { 8 return (find(v.begin (), v.end (), e) != v.end ()); 9 } 10 11 class VectorUtils { 12 public: 13 14 static std::vector<ustring> split_and_trim (const ustring & str, const ustring delim); 15 static ustring concat (std::vector<ustring> &, ustring, std::vector<ustring> = {}); 16 static ustring concat_tags (std::vector<ustring>); 17 static ustring concat_tags_color (std::vector<ustring>, bool pango, int maxlen, unsigned char canvascolor[3]); 18 19 static const std::vector<ustring> stop_ons_tags; 20 21 }; 22 } 23 24