From 4de8f0118e1baf31cf4c859881dfbf39014b566f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 11 May 2014 23:59:19 +0100 Subject: Use raw_convert instead of boost::lexical_cast as it seems that lexical_cast will sometimes use a thousands separator (i.e. it will convert 1234 to a string 1,234). It appears not to be possible safely to turn this off (you have to set the global locale). Instead, raw_convert uses a stringstream which you can imbue() with std::locale::classic() to turn off the locale-specific behaviour. --- src/dcp_time.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/dcp_time.cc') diff --git a/src/dcp_time.cc b/src/dcp_time.cc index 14155fdb..d597e3dc 100644 --- a/src/dcp_time.cc +++ b/src/dcp_time.cc @@ -24,10 +24,10 @@ #include #include #include -#include #include #include "dcp_time.h" #include "exceptions.h" +#include "raw_convert.h" using namespace std; using namespace boost; @@ -78,10 +78,10 @@ Time::Time (string time) boost::throw_exception (DCPReadError ("unrecognised time specification")); } - h = lexical_cast (b[0]); - m = lexical_cast (b[1]); - s = lexical_cast (b[2]); - t = lexical_cast (b[3]); + h = raw_convert (b[0]); + m = raw_convert (b[1]); + s = raw_convert (b[2]); + t = raw_convert (b[3]); } bool -- cgit v1.2.3