Add some more conversions.
[libcxml.git] / src / cxml.cc
index 82e4bc3eca909fe9961dcfe24c6860b73eaaa930..78f75eeef24254365887c395ba8de78dfa6d9126 100644 (file)
@@ -330,6 +330,15 @@ locale_convert (string x)
        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)
@@ -355,6 +364,13 @@ cxml::raw_convert (string 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)