diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-03-22 15:02:18 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-03-22 15:02:18 +0000 |
| commit | 3c371e9aead80bfed91ae208e2ce782c7bf4901b (patch) | |
| tree | e8cce78b77f23919d6ba2e0c2bce21347e623416 /src | |
| parent | 2671859965fae633dcc0700b0774b95f0a331b5f (diff) | |
Add another conversion.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cxml.cc | 16 | ||||
| -rw-r--r-- | src/cxml.h | 4 |
2 files changed, 20 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) { @@ -83,6 +83,10 @@ int raw_convert (std::string v); template <> +unsigned int +raw_convert (std::string v); + +template <> long int raw_convert (std::string v); |
