version 1.14.2.4, 2012/05/25 13:04:22
|
version 1.15, 2011/08/25 10:28:00
|
|
|
_setBinary(hostName,len+1,inst.hdr->hostName,&inst.mem); | _setBinary(hostName,len+1,inst.hdr->hostName,&inst.mem); |
} | } |
| |
|
void SCMOInstance::setHostName_l(const char* hostName, Uint32 len) |
|
{ |
|
// Copy on Write is only necessary if a realloc() becomes necessary |
|
if (inst.mem->freeBytes < ((len+8) & ~7)) |
|
{ |
|
_copyOnWrite(); |
|
} |
|
// copy including trailing '\0' |
|
_setBinary(hostName,len+1,inst.hdr->hostName,&inst.mem); |
|
} |
|
|
const char* SCMOInstance::getHostName() const | const char* SCMOInstance::getHostName() const |
{ | { |
return _getCharString(inst.hdr->hostName,inst.base); | return _getCharString(inst.hdr->hostName,inst.base); |
|
|
return _getCharString(inst.hdr->instNameSpace,inst.base); | return _getCharString(inst.hdr->instNameSpace,inst.base); |
} | } |
| |
void SCMOInstance::completeHostNameAndNamespace( |
|
const char* hn, |
|
Uint32 hnLen, |
|
const char* ns, |
|
Uint32 nsLen) |
|
{ |
|
// hostName is Null or empty String ? |
|
if (0 == inst.hdr->hostName.size || |
|
0 == inst.base[inst.hdr->hostName.start]) |
|
{ |
|
// Copy on Write is only necessary if a realloc() becomes necessary |
|
if (inst.mem->freeBytes < ((hnLen+8) & ~7)) |
|
{ |
|
_copyOnWrite(); |
|
} |
|
// copy including trailing '\0' |
|
_setBinary(hn,hnLen+1,inst.hdr->hostName,&inst.mem); |
|
} |
|
// namespace is Null or empty String ? |
|
if (0 == inst.hdr->instNameSpace.size || |
|
0 == inst.base[inst.hdr->instNameSpace.start]) |
|
{ |
|
setNameSpace_l(ns,nsLen); |
|
} |
|
} |
|
|
|
|
|
void SCMOInstance::buildKeyBindingsFromProperties() | void SCMOInstance::buildKeyBindingsFromProperties() |
{ | { |
Uint32 propNode; | Uint32 propNode; |
|
|
SCMBValue* theInstPropNodeArray= | SCMBValue* theInstPropNodeArray= |
(SCMBValue*)&inst.base[inst.hdr->propertyArray.start]; | (SCMBValue*)&inst.base[inst.hdr->propertyArray.start]; |
| |
inst.hdr->numberKeyBindings = |
|
inst.hdr->theClass.ptr->cls.hdr->keyBindingSet.number; |
|
|
|
for (Uint32 i = 0, k = inst.hdr->numberKeyBindings; i < k; i++) | for (Uint32 i = 0, k = inst.hdr->numberKeyBindings; i < k; i++) |
{ | { |
// If the keybinding is not set. | // If the keybinding is not set. |
|
|
| |
case CIMTYPE_STRING: | case CIMTYPE_STRING: |
{ | { |
CString cstr = ((String*)((void*)&u))->getCString(); |
_setString(*((String*)((void*)&u)), |
const char *cptr = (const char*)cstr; |
|
_setBinary( |
|
cptr, |
|
strlen(cptr) + 1, |
|
scmoUnion->stringValue, | scmoUnion->stringValue, |
pmem ); | pmem ); |
break; | break; |
|
|
// Clear the keybindings after the allocation. Setting the keybindings | // Clear the keybindings after the allocation. Setting the keybindings |
// later causes this value to be reinitialized. | // later causes this value to be reinitialized. |
inst.hdr->numberKeyBindings = 0; | inst.hdr->numberKeyBindings = 0; |
|
|
markAsCompromised(); |
|
} | } |
| |
Uint32 SCMOInstance::getKeyBindingCount() const | Uint32 SCMOInstance::getKeyBindingCount() const |