void PersonnelResourceGetFamilyNameBufLen (IAAFObject *pObj, aafUInt32 *bufLen) { assert (pObj); GetStringBufLen (pObj, kPropID_PersonnelResource_FamilyName, bufLen); }
HRESULT PersonnelResourceGetActorNameBufLen (IAAFObject *pObj, aafUInt32 *bufLen) { assert (pObj); if (IsOptionalPropertyPresent (pObj, kPropID_PersonnelResource_Role)) { GetStringBufLen (pObj, kPropID_PersonnelResource_Role, bufLen); return AAFRESULT_SUCCESS; } else return AAFRESULT_PROP_NOT_PRESENT; }
AAFRESULT STDMETHODCALLTYPE ImplAAFAuxiliaryDescriptor::GetMimeTypeBufLen ( aafUInt32 * pBufSize) { return GetStringBufLen( pBufSize, false, _mimeType ); }
void GetStringValue (IAAFObject * pObj, const aafUID_t propertyID, aafCharacter * buf, aafUInt32 buflen) { assert (pObj); assert (buf); IAAFClassDef *cd=NULL; IAAFPropertyDef *pd=NULL; IAAFPropertyValue *pv=NULL; IAAFTypeDef *td=NULL; IAAFTypeDefString *tds=NULL; aafUInt32 stringBufLen,numCharsWNull; try { GetStringBufLen (pObj, propertyID, &stringBufLen); assert (buflen >= stringBufLen); numCharsWNull = stringBufLen/sizeof (aafCharacter); check (pObj->GetDefinition (&cd)); check (cd->LookupPropertyDef (propertyID, &pd)); check (pObj->GetPropertyValue (pd, &pv)); check (pd->GetTypeDef (&td)); check (td->QueryInterface (IID_IAAFTypeDefString, (void **)&tds)); check (tds->GetElements (pv, (aafMemPtr_t) buf, buflen)); // Make sure we're null-terminated. buf[numCharsWNull-1] = '\0'; tds->Release(); tds=NULL; td->Release(); td=NULL; pv->Release(); pv=NULL; pd->Release(); pd=NULL; cd->Release(); cd=NULL; } catch (...) { // cleanup after error... if (tds) tds->Release(); if (td) td->Release(); if (pv) pv->Release(); if (pd) pd->Release(); if (cd) cd->Release(); throw; } }
AAFRESULT STDMETHODCALLTYPE ImplAAFAuxiliaryDescriptor::GetCharSetBufLen ( aafUInt32 * pBufSize) { return GetStringBufLen( pBufSize, true, _charSet ); }