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.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/dcp.cc') diff --git a/src/dcp.cc b/src/dcp.cc index 7748a97f..7cce30fe 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -26,9 +26,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -46,6 +44,7 @@ #include "cpl.h" #include "signer.h" #include "kdm.h" +#include "raw_convert.h" using std::string; using std::list; @@ -55,7 +54,6 @@ using std::copy; using std::back_inserter; using std::make_pair; using boost::shared_ptr; -using boost::lexical_cast; using namespace libdcp; DCP::DCP (boost::filesystem::path directory) @@ -191,7 +189,7 @@ DCP::write_assetmap (string pkl_uuid, int pkl_length, bool interop, XMLMetadata chunk->add_child("Path")->add_child_text (pkl_uuid + "_pkl.xml"); chunk->add_child("VolumeIndex")->add_child_text ("1"); chunk->add_child("Offset")->add_child_text ("0"); - chunk->add_child("Length")->add_child_text (lexical_cast (pkl_length)); + chunk->add_child("Length")->add_child_text (raw_convert (pkl_length)); for (list >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) { (*i)->write_to_assetmap (asset_list); -- cgit v1.2.3