From 943af65e7833ef96bcfcfa957f1703d3a425c9ff Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 15 Aug 2016 14:39:41 +0100 Subject: Add conversions from char. --- src/locale_convert.cc | 9 +++++++++ src/locale_convert.h | 4 ++++ src/raw_convert.cc | 9 +++++++++ src/raw_convert.h | 4 ++++ 4 files changed, 26 insertions(+) (limited to 'src') diff --git a/src/locale_convert.cc b/src/locale_convert.cc index 64b21274..ca6f6552 100644 --- a/src/locale_convert.cc +++ b/src/locale_convert.cc @@ -150,6 +150,15 @@ dcp::locale_convert (char const * x, int, bool) return x; } +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) diff --git a/src/locale_convert.h b/src/locale_convert.h index 3d55a00e..4c977846 100644 --- a/src/locale_convert.h +++ b/src/locale_convert.h @@ -95,6 +95,10 @@ template <> std::string locale_convert (char const * x, int, bool); +template <> +std::string +locale_convert (char x, int, bool); + template <> std::string locale_convert (boost::filesystem::path x, int, bool); diff --git a/src/raw_convert.cc b/src/raw_convert.cc index 42622bfe..37c8215f 100644 --- a/src/raw_convert.cc +++ b/src/raw_convert.cc @@ -134,6 +134,15 @@ dcp::raw_convert (string v, int, bool) return v; } +template <> +string +dcp::raw_convert (char v, int, bool) +{ + string s; + s += v; + return s; +} + template <> int dcp::raw_convert (string v, int precision, bool fixed) diff --git a/src/raw_convert.h b/src/raw_convert.h index 2bd74c60..28dcd648 100644 --- a/src/raw_convert.h +++ b/src/raw_convert.h @@ -96,6 +96,10 @@ template <> std::string raw_convert (std::string v, int, bool); +template <> +std::string +raw_convert (char v, int, bool); + template <> int raw_convert (std::string v, int, bool); -- cgit v1.2.3