version 1.13, 2005/02/05 22:59:16
|
version 1.14, 2005/03/26 15:58:32
|
|
|
// Brian Lucier (lucier@us.ibm.com) | // Brian Lucier (lucier@us.ibm.com) |
// | // |
// Modified By: | // Modified By: |
|
// David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
inline Uint8 _CQLUtilities_hexCharToNumeric(const Char16 c) |
inline Uint8 _CQLUtilities_hexCharToNumeric(Char16 c) |
{ | { |
Uint8 n; | Uint8 n; |
| |
if (isdigit(c)) |
if (c.isDigit()) |
n = (c - '0'); | n = (c - '0'); |
else if (isupper(c)) |
else if (c.isUpper()) |
n = (c - 'A' + 10); | n = (c - 'A' + 10); |
else // if (islower(c)) | else // if (islower(c)) |
n = (c - 'a' + 10); | n = (c - 'a' + 10); |
|
|
if (*p == '+') | if (*p == '+') |
p++; // skip over the positive sign | p++; // skip over the positive sign |
| |
if (!isdigit(*p)) |
if (!p->isDigit()) |
{ | { |
MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_NUM_FORMAT"), | MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_NUM_FORMAT"), |
String("Error converting string to $0. String '$1' is badly formed."), | String("Error converting string to $0. String '$1' is badly formed."), |
|
|
} | } |
| |
// Add on each digit, checking for overflow errors | // Add on each digit, checking for overflow errors |
while (isxdigit(*p)) |
while (p->isXDigit()) |
{ | { |
// Make sure we won't overflow when we multiply by 16 | // Make sure we won't overflow when we multiply by 16 |
if (x > PEGASUS_UINT64_MAX/16) | if (x > PEGASUS_UINT64_MAX/16) |
|
|
if (*p == '+') | if (*p == '+') |
p++; | p++; |
| |
if (!isdigit(*p)) |
if (!p->isDigit()) |
{ | { |
MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_NUM_FORMAT"), | MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_NUM_FORMAT"), |
String("Error converting string to $0. String '$1' is badly formed."), | String("Error converting string to $0. String '$1' is badly formed."), |
|
|
} | } |
| |
// Add on each digit, checking for overflow errors | // Add on each digit, checking for overflow errors |
while (isxdigit(*p)) |
while (p->isXDigit()) |
{ | { |
// Make sure we won't overflow when we multiply by 16 | // Make sure we won't overflow when we multiply by 16 |
if (x < PEGASUS_SINT64_MIN/16) | if (x < PEGASUS_SINT64_MIN/16) |