summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-15 15:38:21 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-15 15:38:21 +0100
commit124adae15126598fc46f3189aa7e4ab44582b8dc (patch)
tree9c2b0833cccb5dd70cf4bf0ad651364864701931 /src
parent943af65e7833ef96bcfcfa957f1703d3a425c9ff (diff)
Add wchar_t raw_convert.
Diffstat (limited to 'src')
-rw-r--r--src/raw_convert.cc11
-rw-r--r--src/raw_convert.h4
2 files changed, 14 insertions, 1 deletions
diff --git a/src/raw_convert.cc b/src/raw_convert.cc
index 37c8215f..aed965ad 100644
--- a/src/raw_convert.cc
+++ b/src/raw_convert.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
@@ -36,6 +36,7 @@
#include <boost/algorithm/string.hpp>
using std::string;
+using std::wstring;
static
string
@@ -144,6 +145,14 @@ dcp::raw_convert (char v, int, bool)
}
template <>
+string
+dcp::raw_convert (wchar_t const * v, int, bool)
+{
+ wstring w (v);
+ return string (w.begin(), w.end());
+}
+
+template <>
int
dcp::raw_convert (string v, int precision, bool fixed)
{
diff --git a/src/raw_convert.h b/src/raw_convert.h
index 28dcd648..7f31ac37 100644
--- a/src/raw_convert.h
+++ b/src/raw_convert.h
@@ -98,6 +98,10 @@ raw_convert (std::string v, int, bool);
template <>
std::string
+raw_convert (wchar_t const * v, int, bool);
+
+template <>
+std::string
raw_convert (char v, int, bool);
template <>