diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-10-09 19:20:01 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-10-09 19:20:01 +0100 |
| commit | 7930f7685811eb9e9f76651b6ef3dd9fe140b6fe (patch) | |
| tree | dae8be03c59a7c722e3988cd98a6d8ea8c28c2e3 /src/locale_convert.cc | |
| parent | 7c47ecfd45bca468bf1a53f31d6f21cb00f73f26 (diff) | |
More raw/locale_convert.
Diffstat (limited to 'src/locale_convert.cc')
| -rw-r--r-- | src/locale_convert.cc | 27 |
1 files changed, 27 insertions, 0 deletions
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 @@ -198,6 +198,33 @@ dcp::locale_convert (boost::filesystem::path x, int, bool) } 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) { |
