From 516e676dd02ffd24c27cca410a09fa71496b88e9 Mon Sep 17 00:00:00 2001 From: Sascha Volkenandt Date: Tue, 5 Jun 2007 19:30:13 +0000 Subject: - added function to convert anything streamable to string according to a locale --- tools.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools.h b/tools.h index 6b122b0..63450f1 100644 --- a/tools.h +++ b/tools.h @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -54,6 +55,15 @@ To lexical_cast( From const& from ) return result; } +template< typename From > +std::string ConvertToString( From const& from, std::locale const& loc = std::locale() ) +{ + std::ostringstream parser; + parser.imbue( loc ); + parser << from; + return parser.str(); +} + class ReadLock { public: -- cgit v1.2.3