From 3c371e9aead80bfed91ae208e2ce782c7bf4901b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 22 Mar 2019 15:02:18 +0000 Subject: Add another conversion. --- src/cxml.cc | 16 ++++++++++++++++ src/cxml.h | 4 ++++ 2 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/cxml.cc b/src/cxml.cc index 78f75ee..f667584 100644 --- a/src/cxml.cc +++ b/src/cxml.cc @@ -330,6 +330,15 @@ locale_convert (string x) return y; } +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) @@ -371,6 +380,13 @@ cxml::raw_convert (string v) return locale_convert (make_local(v)); } +template <> +unsigned int +cxml::raw_convert (string v) +{ + return locale_convert (make_local(v)); +} + template <> float cxml::raw_convert (string v) diff --git a/src/cxml.h b/src/cxml.h index a2d5b88..20a948a 100644 --- a/src/cxml.h +++ b/src/cxml.h @@ -82,6 +82,10 @@ template <> int raw_convert (std::string v); +template <> +unsigned int +raw_convert (std::string v); + template <> long int raw_convert (std::string v); -- cgit v1.2.3