summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-15 14:39:41 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-15 14:39:41 +0100
commit943af65e7833ef96bcfcfa957f1703d3a425c9ff (patch)
tree3e605dad722d5c7091092c801fd8a3037508644f
parent3652809182f2ff89e552a519658cba2afc57ce28 (diff)
Add conversions from char.
-rw-r--r--src/locale_convert.cc9
-rw-r--r--src/locale_convert.h4
-rw-r--r--src/raw_convert.cc9
-rw-r--r--src/raw_convert.h4
4 files changed, 26 insertions, 0 deletions
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
@@ -152,6 +152,15 @@ dcp::locale_convert (char const * x, int, bool)
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();
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
@@ -97,6 +97,10 @@ 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);
template <>
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
@@ -135,6 +135,15 @@ dcp::raw_convert (string v, int, bool)
}
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
@@ -97,6 +97,10 @@ 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);