summaryrefslogtreecommitdiff
path: root/src/cxml.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-03-22 15:02:18 +0000
committerCarl Hetherington <cth@carlh.net>2019-03-22 15:02:18 +0000
commit3c371e9aead80bfed91ae208e2ce782c7bf4901b (patch)
treee8cce78b77f23919d6ba2e0c2bce21347e623416 /src/cxml.cc
parent2671859965fae633dcc0700b0774b95f0a331b5f (diff)
Add another conversion.
Diffstat (limited to 'src/cxml.cc')
-rw-r--r--src/cxml.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cxml.cc b/src/cxml.cc
index 78f75ee..f667584 100644
--- a/src/cxml.cc
+++ b/src/cxml.cc
@@ -331,6 +331,15 @@ locale_convert (string x)
}
template<>
+unsigned int
+locale_convert (string x)
+{
+ unsigned int y = 0;
+ sscanf (x.c_str(), "%u", &y);
+ return y;
+}
+
+template<>
long int
locale_convert (string x)
{
@@ -372,6 +381,13 @@ cxml::raw_convert (string v)
}
template <>
+unsigned int
+cxml::raw_convert (string v)
+{
+ return locale_convert<unsigned int> (make_local(v));
+}
+
+template <>
float
cxml::raw_convert (string v)
{