projects
/
libdcp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Atmos read/write and untested MXF decryption tool.
[libdcp.git]
/
src
/
locale_convert.cc
diff --git
a/src/locale_convert.cc
b/src/locale_convert.cc
index ca6f65522862301760cb99f9b4ba7e9a5268d44c..89c797599a4374eb60286f8d0a630ce6f9e88d48 100644
(file)
--- a/
src/locale_convert.cc
+++ b/
src/locale_convert.cc
@@
-36,6
+36,7
@@
#include <inttypes.h>
using std::string;
#include <inttypes.h>
using std::string;
+using std::wstring;
template<>
string
template<>
string
@@
-150,6
+151,14
@@
dcp::locale_convert (char const * x, int, bool)
return x;
}
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)
template<>
string
dcp::locale_convert (char x, int, bool)
@@
-176,11
+185,20
@@
dcp::locale_convert (string x, int, bool)
}
template<>
}
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)
{
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;
}
return y;
}