version 1.38, 2002/03/20 17:47:07
|
version 1.40, 2002/03/20 23:10:29
|
|
|
| |
while (first != last) | while (first != last) |
{ | { |
if (x < -922337203685477580LL /* -(1<<63) / 10 */) |
if (x < PEGASUS_LLONG_MIN/10) |
{ | { |
return false; | return false; |
} | } |
|
|
// | // |
// stringToUnsignedInteger | // stringToUnsignedInteger |
// | // |
// [ "+" ] ( positiveDecimalDigit *decimalDigit | "0" ) |
// ( positiveDecimalDigit *decimalDigit | "0" ) |
// | // |
// ATTN-B: handle conversion from hexadecimal. | // ATTN-B: handle conversion from hexadecimal. |
//------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |
|
|
if (!*p) | if (!*p) |
return false; | return false; |
| |
// Skip optional sign: |
// If the first digit is a zero, then it must be the last: |
|
|
if (*p == '-') |
|
return false; |
|
|
|
if (*p == '+') |
|
p++; |
|
|
|
// If the next thing is a zero, then it must be the last: |
|
| |
if (*p == '0') | if (*p == '0') |
return p[1] == '\0'; | return p[1] == '\0'; |
|
|
| |
while (first != last) | while (first != last) |
{ | { |
if (x > 1844674407370955161ULL /* (1<<64 - 1) / 10 */) |
if (x > PEGASUS_ULLONG_MAX/10) |
{ | { |
return false; | return false; |
} | } |
x = 10 * x; | x = 10 * x; |
Uint64 newDigit = (*first++ - '0'); | Uint64 newDigit = (*first++ - '0'); |
if (18446744073709551615ULL - x < newDigit) |
if (PEGASUS_ULLONG_MAX - x < newDigit) |
{ | { |
return false; | return false; |
} | } |
|
|
{ | { |
// ATTN-B: accepting only UTF-8 for now! (affects string and char16): | // ATTN-B: accepting only UTF-8 for now! (affects string and char16): |
| |
|
// The Specification for the Representation of CIM in XML does not indicate |
|
// that a default value should be used when a VALUE element is empty. |
|
#if 0 |
// If strlen == 0, set to default value for type | // If strlen == 0, set to default value for type |
| |
if (strlen(valueString)==0) | if (strlen(valueString)==0) |
|
|
case CIMType::REAL64: return CIMValue(Real64(0)); | case CIMType::REAL64: return CIMValue(Real64(0)); |
} | } |
} | } |
|
#endif |
| |
// Create value per type | // Create value per type |
switch (type) | switch (type) |