diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-05-11 23:59:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-05-11 23:59:19 +0100 |
| commit | 4de8f0118e1baf31cf4c859881dfbf39014b566f (patch) | |
| tree | 91be88947914d05ff942cbefff6c71eab187cc3c /src/mxf_asset.cc | |
| parent | 3390da35584709ea0626ec1fefd3bf5d797bcc00 (diff) | |
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.
Diffstat (limited to 'src/mxf_asset.cc')
| -rw-r--r-- | src/mxf_asset.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mxf_asset.cc b/src/mxf_asset.cc index c2428a3c..f16fd35b 100644 --- a/src/mxf_asset.cc +++ b/src/mxf_asset.cc @@ -23,7 +23,6 @@ #include <iostream> #include <boost/filesystem.hpp> -#include <boost/lexical_cast.hpp> #include <libxml++/nodes/element.h> #include "AS_DCP.h" #include "KM_prng.h" @@ -33,12 +32,12 @@ #include "metadata.h" #include "exceptions.h" #include "kdm.h" +#include "raw_convert.h" using std::string; using std::list; using std::pair; using boost::shared_ptr; -using boost::lexical_cast; using boost::dynamic_pointer_cast; using namespace libdcp; @@ -117,10 +116,10 @@ MXFAsset::write_to_cpl (xmlpp::Element* node) const } a->add_child ("Id")->add_child_text ("urn:uuid:" + _uuid); a->add_child ("AnnotationText")->add_child_text (_file_name.string ()); - a->add_child ("EditRate")->add_child_text (lexical_cast<string> (_edit_rate) + " 1"); - a->add_child ("IntrinsicDuration")->add_child_text (lexical_cast<string> (_intrinsic_duration)); - a->add_child ("EntryPoint")->add_child_text (lexical_cast<string> (_entry_point)); - a->add_child ("Duration")->add_child_text (lexical_cast<string> (_duration)); + a->add_child ("EditRate")->add_child_text (raw_convert<string> (_edit_rate) + " 1"); + a->add_child ("IntrinsicDuration")->add_child_text (raw_convert<string> (_intrinsic_duration)); + a->add_child ("EntryPoint")->add_child_text (raw_convert<string> (_entry_point)); + a->add_child ("Duration")->add_child_text (raw_convert<string> (_duration)); if (!_key_id.empty ()) { a->add_child("KeyId")->add_child_text ("urn:uuid:" + _key_id); } |
