Add another raw_convert type.
authorCarl Hetherington <cth@carlh.net>
Tue, 25 Jun 2019 20:38:56 +0000 (21:38 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 25 Jun 2019 20:38:56 +0000 (21:38 +0100)
src/locale_convert.cc
src/locale_convert.h
src/raw_convert.cc
src/raw_convert.h

index 46d5507f83bb2eb9532360281268c430ce37b62a..915cac826bbe58387977ed1c355c1a5243ed8985 100644 (file)
@@ -268,6 +268,19 @@ dcp::locale_convert (string x, int, bool)
        return y;
 }
 
+template<>
+unsigned long long
+dcp::locale_convert (string x, int, bool)
+{
+       unsigned long long y = 0;
+#ifdef LIBDCP_WINDOWS
+       __mingw_sscanf (x.c_str(), "%llud", &y);
+#else
+       sscanf (x.c_str(), "%llud", &y);
+#endif
+       return y;
+}
+
 template<>
 float
 dcp::locale_convert (string x, int, bool)
index d8d84711dc3667a3d85ac4e909d2ebd65dafeb52..aaf0dd6eaaff388c985192849b4af52c0ab40ab8 100644 (file)
@@ -143,6 +143,10 @@ template <>
 long long
 locale_convert (std::string x, int, bool);
 
+template <>
+unsigned long long
+locale_convert (std::string x, int, bool);
+
 template <>
 float
 locale_convert (std::string x, int, bool);
index 7b4e6c6d03f0a2b6398e10808164a8d330229437..b4dcb5be92ec41eac566e73a3b8caafbeb49987c 100644 (file)
@@ -210,6 +210,13 @@ dcp::raw_convert (string v, int precision, bool fixed)
        return locale_convert<long long> (make_local (v), precision, fixed);
 }
 
+template <>
+unsigned long long
+dcp::raw_convert (string v, int precision, bool fixed)
+{
+       return locale_convert<unsigned long long> (make_local (v), precision, fixed);
+}
+
 template <>
 int
 dcp::raw_convert (char const * v, int precision, bool fixed)
index c7b04823732ed342c1f80eaf8ed0cbf5871b8bc8..fb3c79546ef62839952662dc3faf55ccaa7fdfc6 100644 (file)
@@ -136,6 +136,10 @@ template <>
 long long
 raw_convert (std::string v, int, bool);
 
+template <>
+unsigned long long
+raw_convert (std::string v, int, bool);
+
 template <>
 int
 raw_convert (char const * v, int, bool);