Missing #include.
[libcxml.git] / src / cxml.cc
index 82e4bc3eca909fe9961dcfe24c6860b73eaaa930..a51b9a42762c50c588a0a8983204cf2892109c3c 100644 (file)
 
 */
 
+#include "cxml.h"
+#include <libxml++/libxml++.h>
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
-#include <libxml++/libxml++.h>
-#include "cxml.h"
+#include <cstdio>
 
 using std::string;
 using std::list;
@@ -330,6 +331,37 @@ 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)
+{
+       long int y = 0;
+       sscanf (x.c_str(), "%ld", &y);
+       return y;
+}
+
+template<>
+long long
+locale_convert (string x)
+{
+       long long y = 0;
+#ifdef LIBCXML_WINDOWS
+       __mingw_sscanf (x.c_str(), "%lld", &y);
+#else
+       sscanf (x.c_str(), "%lld", &y);
+#endif
+       return y;
+}
+
 template<>
 float
 locale_convert (string x)
@@ -355,6 +387,27 @@ 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 <>
+long long
+cxml::raw_convert (string v)
+{
+       return locale_convert<long long> (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)