diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-03-19 21:22:23 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-03-19 21:22:23 +0000 |
| commit | be5d6b54ffbc96c2b7823356c0b79583784ca91d (patch) | |
| tree | 51cedf3114e4b6ab9830ca346b2f41b1a2a5fc03 /src/cxml.cc | |
| parent | 670c528a584d96e8bb6009f996204e9ecf174f54 (diff) | |
Add some more conversions.
Diffstat (limited to 'src/cxml.cc')
| -rw-r--r-- | src/cxml.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cxml.cc b/src/cxml.cc index 82e4bc3..78f75ee 100644 --- a/src/cxml.cc +++ b/src/cxml.cc @@ -331,6 +331,15 @@ locale_convert (string x) } template<> +long int +locale_convert (string x) +{ + long int y = 0; + sscanf (x.c_str(), "%ld", &y); + return y; +} + +template<> float locale_convert (string x) { @@ -356,6 +365,13 @@ cxml::raw_convert (string v) } template <> +long int +cxml::raw_convert (string v) +{ + return locale_convert<long int> (make_local(v)); +} + +template <> float cxml::raw_convert (string v) { |
