*/
/*
- $Revision: 1.41 $
- $Date: 2010/11/03 10:26:30 $
+ $Revision: 1.42 $
+ $Date: 2010/11/08 10:11:19 $
$Author: faust $
*/
{
x = strtoul(str.c_str(), NULL, 10);
+if (errno == ERANGE)
+ return -1;
+
+return 0;
+}
+//---------------------------------------------------------------------------
+int str2x(const std::string & str, long & x)
+{
+x = strtol(str.c_str(), NULL, 10);
+
+if (errno == ERANGE)
+ return -1;
+
+return 0;
+}
+//---------------------------------------------------------------------------
+int str2x(const std::string & str, unsigned long & x)
+{
+x = strtoul(str.c_str(), NULL, 10);
+
if (errno == ERANGE)
return -1;
return unsigned2str(x, s);
}
//---------------------------------------------------------------------------
+const std::string & x2str(unsigned long x, std::string & s)
+{
+return unsigned2str(x, s);
+}
+//---------------------------------------------------------------------------
const std::string & x2str(unsigned long long x, std::string & s)
{
return unsigned2str(x, s);