projects
/
libcxml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
670c528
)
Add some more conversions.
author
Carl Hetherington
<cth@carlh.net>
Tue, 19 Mar 2019 21:22:23 +0000
(21:22 +0000)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 19 Mar 2019 21:22:23 +0000
(21:22 +0000)
src/cxml.cc
patch
|
blob
|
history
src/cxml.h
patch
|
blob
|
history
diff --git
a/src/cxml.cc
b/src/cxml.cc
index 82e4bc3eca909fe9961dcfe24c6860b73eaaa930..78f75eeef24254365887c395ba8de78dfa6d9126 100644
(file)
--- a/
src/cxml.cc
+++ b/
src/cxml.cc
@@
-330,6
+330,15
@@
locale_convert (string x)
return y;
}
return y;
}
+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)
template<>
float
locale_convert (string x)
@@
-355,6
+364,13
@@
cxml::raw_convert (string v)
return locale_convert<int> (make_local(v));
}
return locale_convert<int> (make_local(v));
}
+template <>
+long int
+cxml::raw_convert (string v)
+{
+ return locale_convert<long int> (make_local(v));
+}
+
template <>
float
cxml::raw_convert (string v)
template <>
float
cxml::raw_convert (string v)
diff --git
a/src/cxml.h
b/src/cxml.h
index bd9db003721f8ec78af0c0301e38adfb8549afd3..a2d5b88b3aeb423db5918d16dd50fa52e512157e 100644
(file)
--- a/
src/cxml.h
+++ b/
src/cxml.h
@@
-82,6
+82,10
@@
template <>
int
raw_convert (std::string v);
int
raw_convert (std::string v);
+template <>
+long int
+raw_convert (std::string v);
+
template <>
float
raw_convert (std::string v);
template <>
float
raw_convert (std::string v);