Add another conversion.
[libcxml.git] / src / cxml.cc
index 78f75eeef24254365887c395ba8de78dfa6d9126..f667584f4fee595331061d0d401b90009356db00 100644 (file)
@@ -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<long int> (make_local(v));
 }
 
+template <>
+unsigned int
+cxml::raw_convert (string v)
+{
+       return locale_convert<unsigned int> (make_local(v));
+}
+
 template <>
 float
 cxml::raw_convert (string v)