Add Atmos read/write and untested MXF decryption tool.
[libdcp.git] / src / locale_convert.cc
index ca6f65522862301760cb99f9b4ba7e9a5268d44c..89c797599a4374eb60286f8d0a630ce6f9e88d48 100644 (file)
@@ -36,6 +36,7 @@
 #include <inttypes.h>
 
 using std::string;
+using std::wstring;
 
 template<>
 string
@@ -150,6 +151,14 @@ dcp::locale_convert (char const * x, int, bool)
        return x;
 }
 
+template<>
+string
+dcp::locale_convert (wchar_t const * x, int, bool)
+{
+       wstring s (x);
+       return string (s.begin(), s.end());
+}
+
 template<>
 string
 dcp::locale_convert (char x, int, bool)
@@ -176,11 +185,20 @@ dcp::locale_convert (string x, int, bool)
 }
 
 template<>
-int64_t
+long
+dcp::locale_convert (string x, int, bool)
+{
+       long int y = 0;
+       sscanf (x.c_str(), "%ld", &y);
+       return y;
+}
+
+template<>
+long long
 dcp::locale_convert (string x, int, bool)
 {
-       int64_t y = 0;
-       sscanf (x.c_str(), "%" PRId64, &y);
+       long long y = 0;
+       sscanf (x.c_str(), "%lld", &y);
        return y;
 }