- added NumericString.h

- NumberParser improvements (internal Poco locale-awareness and parsing)
This commit is contained in:
Aleksandar Fabijanic
2012-09-30 05:17:56 +00:00
parent 3efcb444e0
commit f70ac1ca07
27 changed files with 904 additions and 199 deletions

View File

@@ -52,19 +52,19 @@ int icompare(const std::string& str, std::string::size_type pos, std::string::si
std::string::const_iterator end1 = str.begin() + pos + n;
while (it1 != end1 && it2 != end2)
{
std::string::value_type c1 = Ascii::toLower(*it1);
std::string::value_type c2 = Ascii::toLower(*it2);
if (c1 < c2)
return -1;
else if (c1 > c2)
return 1;
++it1; ++it2;
std::string::value_type c1 = Ascii::toLower(*it1);
std::string::value_type c2 = Ascii::toLower(*it2);
if (c1 < c2)
return -1;
else if (c1 > c2)
return 1;
++it1; ++it2;
}
if (it1 == end1)
if (it1 == end1)
return it2 == end2 ? 0 : -1;
else
return 1;
else
return 1;
}
@@ -122,19 +122,19 @@ int icompare(const std::string& str, std::string::size_type pos, std::string::si
std::string::const_iterator end = str.begin() + pos + n;
while (it != end && *ptr)
{
std::string::value_type c1 = Ascii::toLower(*it);
std::string::value_type c2 = Ascii::toLower(*ptr);
if (c1 < c2)
return -1;
else if (c1 > c2)
return 1;
++it; ++ptr;
std::string::value_type c1 = Ascii::toLower(*it);
std::string::value_type c2 = Ascii::toLower(*ptr);
if (c1 < c2)
return -1;
else if (c1 > c2)
return 1;
++it; ++ptr;
}
if (it == end)
if (it == end)
return *ptr == 0 ? 0 : -1;
else
return 1;
else
return 1;
}