diff options
| -rw-r--r-- | src/locale_convert.cc | 176 | ||||
| -rw-r--r-- | src/locale_convert.h | 64 |
2 files changed, 0 insertions, 240 deletions
diff --git a/src/locale_convert.cc b/src/locale_convert.cc index 2c7c74ef..b9fac11d 100644 --- a/src/locale_convert.cc +++ b/src/locale_convert.cc @@ -43,182 +43,6 @@ 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) -{ - char buffer[64]; - snprintf (buffer, sizeof(buffer), "%d", x); - return buffer; -} - - -template<> -string -dcp::locale_convert (unsigned int x, int, bool) -{ - char buffer[64]; - snprintf (buffer, sizeof(buffer), "%u", x); - return buffer; -} - - -template<> -string -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; -} - - -template<> -string -dcp::locale_convert (unsigned long int x, int, bool) -{ - char buffer[64]; - snprintf (buffer, sizeof(buffer), "%lu", x); - return buffer; -} - - -template<> -string -dcp::locale_convert (long long int x, int, bool) -{ - char buffer[64]; -#ifdef LIBDCP_WINDOWS - __mingw_snprintf (buffer, sizeof(buffer), "%lld", x); -#else - snprintf (buffer, sizeof(buffer), "%lld", x); -#endif - return buffer; -} - - -template<> -string -dcp::locale_convert (unsigned long long int x, int, bool) -{ - char buffer[64]; -#ifdef LIBDCP_WINDOWS - __mingw_snprintf (buffer, sizeof(buffer), "%llu", x); -#else - snprintf (buffer, sizeof(buffer), "%llu", x); -#endif - return buffer; -} - - -template<> -string -dcp::locale_convert (float x, int precision, bool fixed) -{ - char format[64]; - if (fixed) { - snprintf (format, sizeof(format), "%%.%df", precision); - } else { - snprintf (format, sizeof(format), "%%.%dg", precision); - } - char buffer[64]; - snprintf (buffer, sizeof(buffer), format, x); - return buffer; -} - - -template<> -string -dcp::locale_convert (double x, int precision, bool fixed) -{ - char format[64]; - if (fixed) { - snprintf (format, sizeof(format), "%%.%df", precision); - } else { - snprintf (format, sizeof(format), "%%.%dg", precision); - } - char buffer[64]; - snprintf (buffer, sizeof(buffer), format, x); - return buffer; -} - - -template<> -string -dcp::locale_convert (string x, int, bool) -{ - return x; -} - - -template<> -string -dcp::locale_convert (char* x, int, bool) -{ - return x; -} - - -template<> -string -dcp::locale_convert (char const * x, int, bool) -{ - return x; -} - - -template<> -string -dcp::locale_convert (wchar_t const * x, int, bool) -{ - wstring s (x); - return string (s.begin(), s.end()); -} - - -template<> -string -dcp::locale_convert (char x, int, bool) -{ - string s; - s += x; - return s; -} - - -template<> -string -dcp::locale_convert (boost::filesystem::path x, int, bool) -{ - return x.string(); -} template<> diff --git a/src/locale_convert.h b/src/locale_convert.h index 1323e704..d887f63b 100644 --- a/src/locale_convert.h +++ b/src/locale_convert.h @@ -64,70 +64,6 @@ locale_convert (Q, int precision = 16, bool fixed = false) } 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); - -template <> -std::string -locale_convert (unsigned int x, int, bool); - -template <> -std::string -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 (unsigned long long int x, int, bool); - -template <> -std::string -locale_convert (float x, int precision, bool fixed); - -template <> -std::string -locale_convert (double x, int precision, bool fixed); - -template <> -std::string -locale_convert (std::string x, int, bool); - -template <> -std::string -locale_convert (char* x, int, bool); - -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); |
