summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd/convert.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/pbd/convert.h')
-rw-r--r--libs/pbd/pbd/convert.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/pbd/pbd/convert.h b/libs/pbd/pbd/convert.h
index 00176659cf..458e4aebe9 100644
--- a/libs/pbd/pbd/convert.h
+++ b/libs/pbd/pbd/convert.h
@@ -22,6 +22,8 @@
#include <string>
#include <vector>
+#include <sstream>
+#include <iostream>
namespace PBD {
@@ -37,6 +39,14 @@ std::string length2string (const int64_t frames, const double sample_rate);
std::vector<std::string> internationalize (const char *, const char **);
bool strings_equal_ignore_case (const std::string& a, const std::string& b);
+template <class T> std::string
+to_string (T t, std::ios_base & (*f)(std::ios_base&))
+{
+ std::ostringstream oss;
+ oss << f << t;
+ return oss.str();
+}
+
} //namespace PBD
#endif /* __pbd_convert_h__ */