X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flocale_convert.h;h=ab1984e419274a8a8763b19b8016a64578e3e35c;hb=6e1558f51d4f90c0adf6b18dc8143274167e4d89;hp=f7552f68d267074049efda601366804f727d5bb0;hpb=eec238a778d631b8549c640178e1ab28b07505f4;p=libdcp.git diff --git a/src/locale_convert.h b/src/locale_convert.h index f7552f68..ab1984e4 100644 --- a/src/locale_convert.h +++ b/src/locale_convert.h @@ -34,23 +34,34 @@ #ifndef LIBDCP_LOCALE_CONVERT_H #define LIBDCP_LOCALE_CONVERT_H +#include "util.h" +#include #include #include -#include #include namespace dcp { template P -locale_convert (Q x, int precision = 16, bool fixed = false) +locale_convert (Q, int precision = 16, bool fixed = false) { /* We can't write a generic version of locale_convert; all required versions must be specialised. */ BOOST_STATIC_ASSERT (sizeof (Q) == 0); + LIBDCP_UNUSED(precision); + LIBDCP_UNUSED(fixed); } +template <> +std::string +locale_convert (unsigned char x, int, bool); + +template <> +std::string +locale_convert (unsigned short int x, int, bool); + template <> std::string locale_convert (int x, int, bool); @@ -61,11 +72,19 @@ locale_convert (unsigned int x, int, bool); template <> std::string -locale_convert (int64_t x, int, bool); +locale_convert (long int x, int, bool); + +template <> +std::string +locale_convert (unsigned long int x, int, bool); + +template <> +std::string +locale_convert (long long int x, int, bool); template <> std::string -locale_convert (uint64_t x, int, bool); +locale_convert (unsigned long long int x, int, bool); template <> std::string @@ -87,12 +106,48 @@ template <> std::string locale_convert (char const * x, int, bool); +template <> +std::string +locale_convert (wchar_t const * x, int, bool); + +template <> +std::string +locale_convert (char x, int, bool); + +template <> +std::string +locale_convert (boost::filesystem::path x, int, bool); + +template <> +unsigned char +locale_convert (std::string x, int, bool); + +template <> +unsigned short int +locale_convert (std::string x, int, bool); + +template <> +unsigned int +locale_convert (std::string x, int, bool); + template <> int locale_convert (std::string x, int, bool); template <> -int64_t +long +locale_convert (std::string x, int, bool); + +template <> +unsigned long +locale_convert (std::string x, int, bool); + +template <> +long long +locale_convert (std::string x, int, bool); + +template <> +unsigned long long locale_convert (std::string x, int, bool); template <>