version 1.38, 2010/02/04 07:17:17
|
version 1.38.2.1, 2011/10/18 13:45:16
|
|
|
/** | /** |
Function to convert CMPIValue to SCMBUnion | Function to convert CMPIValue to SCMBUnion |
*/ | */ |
SCMBUnion value2SCMOValue(const CMPIValue* data,const CMPIType type) |
SCMBUnion value2SCMOValue( |
|
const CMPIValue* data, |
|
const CMPIType type, |
|
Boolean &nullValue) |
{ | { |
SCMBUnion scmoData= { { { 0 }, 0 } }; | SCMBUnion scmoData= { { { 0 }, 0 } }; |
|
nullValue = false; |
| |
PEGASUS_ASSERT(!(type&CMPI_ARRAY)); | PEGASUS_ASSERT(!(type&CMPI_ARRAY)); |
| |
|
if (data == NULL) |
|
{ |
|
nullValue = true; |
|
return scmoData; |
|
} |
|
|
switch (type) | switch (type) |
{ | { |
case CMPI_dateTime: | case CMPI_dateTime: |
|
|
{ | { |
scmoData.dateTimeValue = *cimdt; | scmoData.dateTimeValue = *cimdt; |
} | } |
|
else |
|
{ |
|
nullValue = true; |
|
} |
break; | break; |
} | } |
case CMPI_chars: | case CMPI_chars: |
|
|
scmoData.extString.length = | scmoData.extString.length = |
strlen(scmoData.extString.pchar); | strlen(scmoData.extString.pchar); |
} | } |
|
else |
|
{ |
|
nullValue = true; |
|
} |
break; | break; |
} | } |
case CMPI_charsptr: | case CMPI_charsptr: |
|
|
scmoData.extString.length = | scmoData.extString.length = |
strlen(scmoData.extString.pchar); | strlen(scmoData.extString.pchar); |
} | } |
|
else |
|
{ |
|
nullValue = true; |
|
} |
break; | break; |
} | } |
case CMPI_string: | case CMPI_string: |
|
|
scmoData.extString.length = | scmoData.extString.length = |
strlen(scmoData.extString.pchar); | strlen(scmoData.extString.pchar); |
} | } |
|
else |
|
{ |
|
nullValue = true; |
|
} |
break; | break; |
} | } |
case CMPI_ref: | case CMPI_ref: |
|
|
{ | { |
scmoData.extRefPtr = (SCMOInstance*)data->inst->hdl; | scmoData.extRefPtr = (SCMOInstance*)data->inst->hdl; |
} | } |
|
else |
|
{ |
|
nullValue = true; |
|
} |
break; | break; |
} | } |
case CMPI_boolean: | case CMPI_boolean: |