X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flocale_convert.cc;h=5e7c350f4098138370ee763c3deeae548330c066;hb=9eba1ff84fd89e2ff04181799f2185c8575de16d;hp=0f0b5fa2311bda699d23e94ad92e17793d7710f3;hpb=7c47ecfd45bca468bf1a53f31d6f21cb00f73f26;p=libdcp.git diff --git a/src/locale_convert.cc b/src/locale_convert.cc index 0f0b5fa2..5e7c350f 100644 --- a/src/locale_convert.cc +++ b/src/locale_convert.cc @@ -197,6 +197,33 @@ dcp::locale_convert (boost::filesystem::path x, int, bool) 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)