diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-06-05 19:30:13 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-06-05 19:30:13 +0000 |
commit | 516e676dd02ffd24c27cca410a09fa71496b88e9 (patch) | |
tree | 695b5c665805cf2b30e823491439c69d4342785e | |
parent | fec15b76036ebc651c581a344f4815cd2512f239 (diff) | |
download | vdr-plugin-live-516e676dd02ffd24c27cca410a09fa71496b88e9.tar.gz vdr-plugin-live-516e676dd02ffd24c27cca410a09fa71496b88e9.tar.bz2 |
- added function to convert anything streamable to string according to a locale
-rw-r--r-- | tools.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -3,6 +3,7 @@ #include <ctime> #include <istream> +#include <locale> #include <ostream> #include <sstream> #include <stdexcept> @@ -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: |