using std::string;
using std::wstring;
+template<>
+string
+dcp::locale_convert (unsigned char x, int, bool)
+{
+ char buffer[64];
+ snprintf (buffer, sizeof(buffer), "%hhd", x);
+ return buffer;
+}
+
+template<>
+string
+dcp::locale_convert (unsigned short int x, int, bool)
+{
+ char buffer[64];
+ snprintf (buffer, sizeof(buffer), "%hd", x);
+ return buffer;
+}
+
template<>
string
dcp::locale_convert (int x, int, bool)
dcp::locale_convert (long int x, int, bool)
{
char buffer[64];
+#ifdef LIBDCP_WINDOWS
+ __mingw_snprintf (buffer, sizeof(buffer), "%ld", x);
+#else
snprintf (buffer, sizeof(buffer), "%ld", x);
+#endif
return buffer;
}
return x.string();
}
+template<>
+unsigned char
+dcp::locale_convert (string x, int, bool)
+{
+ unsigned char y = 0;
+ sscanf (x.c_str(), "%hhu", &y);
+ return y;
+}
+
+template<>
+unsigned short int
+dcp::locale_convert (string x, int, bool)
+{
+ unsigned short int y = 0;
+ sscanf (x.c_str(), "%hu", &y);
+ return y;
+}
+
+template<>
+unsigned int
+dcp::locale_convert (string x, int, bool)
+{
+ int y = 0;
+ sscanf (x.c_str(), "%u", &y);
+ return y;
+}
+
template<>
int
dcp::locale_convert (string x, int, bool)
dcp::locale_convert (string x, int, bool)
{
long long y = 0;
+#ifdef LIBDCP_WINDOWS
+ __mingw_sscanf (x.c_str(), "%lld", &y);
+#else
sscanf (x.c_str(), "%lld", &y);
+#endif
return y;
}