Commit 3dbb2099 authored by Mathieu Giraud's avatar Mathieu Giraud

core/tools.{h,cpp}: string_of_map()

parent 7f08921e
......@@ -74,6 +74,14 @@ string scientific_string_of_double(double number)
return ss.str();
string string_of_map(map <string, string> m, string before)
stringstream ss;
for (auto x: m)
ss << before << x.first << ":" << x.second;
return ss.str();
bool is_extended_nucleotide(char nuc) {
switch(nuc) {
......@@ -108,6 +108,7 @@ bool pair_occurrence_sort(pair<T, int> a, pair<T, int> b);
string string_of_int(int number);
string fixed_string_of_float(float number, int precision);
string scientific_string_of_double(double number);
string string_of_map(map <string, string> m, string before);
* @param nuc is A, C, G, T or any extended nucleotide (or lowercase)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment