version 1.39, 2002/03/20 19:13:40
|
version 1.40, 2002/03/20 23:10:29
|
|
|
// | // |
// 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'; |
|
|
{ | { |
// 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) |