version 1.51, 2002/05/06 05:10:32
|
version 1.52, 2002/05/11 21:36:29
|
|
|
{ | { |
// 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 ATTN-RK-P3-20020321: Take this code out when null qualifiers are fixed |
|
// If strlen == 0, set to default value for type |
|
|
|
if (strlen(valueString)==0) |
|
{ |
|
switch (type) |
|
{ |
|
case CIMType::BOOLEAN: return CIMValue(false); |
|
case CIMType::STRING: return CIMValue(valueString); |
|
case CIMType::CHAR16: return CIMValue(Char16('\0')); |
|
case CIMType::UINT8: return CIMValue(Uint8(0)); |
|
case CIMType::UINT16: return CIMValue(Uint16(0)); |
|
case CIMType::UINT32: return CIMValue(Uint32(0)); |
|
case CIMType::UINT64: return CIMValue(Uint64(0)); |
|
case CIMType::SINT8: return CIMValue(Sint8(0)); |
|
case CIMType::SINT16: return CIMValue(Sint16(0)); |
|
case CIMType::SINT32: return CIMValue(Sint32(0)); |
|
case CIMType::SINT64: return CIMValue(Sint64(0)); |
|
case CIMType::REAL32: return CIMValue(Real32(0)); |
|
case CIMType::REAL64: return CIMValue(Real64(0)); |
|
} |
|
} |
|
//#endif |
|
|
|
// Create value per type | // Create value per type |
switch (type) | switch (type) |
{ | { |
|
|
// | // |
// getQualifierElement() | // getQualifierElement() |
// | // |
// <!ELEMENT QUALIFIER (VALUE|VALUE.ARRAY)> |
// <!ELEMENT QUALIFIER (VALUE|VALUE.ARRAY)?> |
// <!ATTLIST QUALIFIER | // <!ATTLIST QUALIFIER |
// %CIMName; | // %CIMName; |
// %CIMType; #REQUIRED | // %CIMType; #REQUIRED |
|
|
| |
// Get VALUE or VALUE.ARRAY element: | // Get VALUE or VALUE.ARRAY element: |
| |
// ATTN: KS P1 4 March 2002 - Requires either value or array element or |
|
// generates exception. Correct for spec but means no NULL values on qualifier |
|
// values. Alternative is to set NULL value and continue |
|
|
|
CIMValue value; | CIMValue value; |
| |
if (!getValueElement(parser, type, value) && | if (!getValueElement(parser, type, value) && |
!getValueArrayElement(parser, type, value)) | !getValueArrayElement(parser, type, value)) |
{ | { |
throw XmlSemanticError(parser.getLine(), |
value.setNullValue(type, false); |
"Expected VALUE or VALUE.ARRAY element"); |
|
} | } |
| |
// Expect </QUALIFIER>: | // Expect </QUALIFIER>: |