diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-09-12 11:13:58 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-09-12 11:13:58 +0100 |
| commit | 732f931e0559f29100b56f7f4a6e6be8820f0ff7 (patch) | |
| tree | 6ca92c2a00d15b7136b31b03c44f49430f779e5a /src | |
| parent | 141ab2fa29b5816c1b9eef46b85e146f73178b1b (diff) | |
| parent | 599af5820d963f9e14516182524f05285c77f66e (diff) | |
Merge branch '1.0' of ssh://main.carlh.net/home/carl/git/libdcp into 1.0
Diffstat (limited to 'src')
| -rw-r--r-- | src/raw_convert.cc | 7 | ||||
| -rw-r--r-- | src/raw_convert.h | 4 | ||||
| -rw-r--r-- | src/smpte_subtitle_asset.cc | 5 | ||||
| -rw-r--r-- | src/subtitle_asset.cc | 7 |
4 files changed, 16 insertions, 7 deletions
diff --git a/src/raw_convert.cc b/src/raw_convert.cc index aed965ad..432ce394 100644 --- a/src/raw_convert.cc +++ b/src/raw_convert.cc @@ -160,6 +160,13 @@ dcp::raw_convert (string v, int precision, bool fixed) } template <> +long +dcp::raw_convert (string v, int precision, bool fixed) +{ + return locale_convert<long> (make_local (v), precision, fixed); +} + +template <> int dcp::raw_convert (char const * v, int precision, bool fixed) { diff --git a/src/raw_convert.h b/src/raw_convert.h index 7f31ac37..8ce5220e 100644 --- a/src/raw_convert.h +++ b/src/raw_convert.h @@ -109,6 +109,10 @@ int raw_convert (std::string v, int, bool); template <> +long +raw_convert (std::string v, int, bool); + +template <> int raw_convert (char const * v, int, bool); diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index 128729d8..3b30a0c7 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -103,7 +103,10 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file) } catch (cxml::Error& e) { boost::throw_exception ( DCPReadError ( - String::compose ("MXF failed with %1, XML failed with %2", file, static_cast<int> (r), e.what ()) + String::compose ( + "Failed to read subtitle file %1; MXF failed with %2, XML failed with %3", + file, static_cast<int> (r), e.what () + ) ) ); } diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index 02dfd80f..ac87148d 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -111,12 +111,7 @@ optional_number_attribute (xmlpp::Element const * node, string name) std::string t = s.get (); boost::erase_all (t, " "); - locked_stringstream u; - u.imbue (std::locale::classic ()); - u << t; - T n; - u >> n; - return n; + return raw_convert<T> (t); } SubtitleAsset::ParseState |
