Populate the supplied chain with the binary object held by the named member in the identified data object. This assumes the named data class member holds binary objects and that the supplied data object id is valid. As object repositories do not directly hold binary values, the member value will be the address of the binary object residing in a separate binary repository. The address is then used in a Fetch() on the binary repository.
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hdbObjRepos::GetBinary | (hzChain&,hdbMember*,uint32_t,) |
Declared in file: hzDatabase.h
Defined in file : hdbObjRepos.cpp
Function Logic:
Function body:
hzEcode hdbObjRepos::GetBinary (hzChain& Z)hdbMember* pMbr, uint32_t objId,
{
// Populate the supplied chain with the binary object held by the named member in the identified data object.
//
// This assumes the named data class member holds binary objects and that the supplied data object id is valid. As object repositories do not directly hold
// binary values, the member value will be the address of the binary object residing in a separate binary repository. The address is then used in a Fetch()
// on the binary repository.
//
// Arguments: 1) atom The atom to be set to the member's value.
// 2) member The name of member
// 3) objId The id of the data object
//
// Returns: E_RANGE If the object id is invalid
// E_TYPE If the member is not BASETYPE_BINARY or BASETYPE_TXTDOC
// E_OK If the operation was successful
_hzfunc("hdbObjRepos::GetBinary") ;
// Exit if cache not open
_hdb_ck_initstate(m_Name, m_eReposInit, HDB_REPOS_OPEN) ;
if (!pMbr)
return hzerr(E_ARGUMENT, "No member supplied") ;
if (pMbr->Class() != m_pClass)
return hzerr(E_CORRUPT, "No class member of %s in class %s", pMbr->txtName(), m_pClass->txtType()) ;
// And check member is a document or a binary
if (pMbr->Basetype() != BASETYPE_BINARY && pMbr->Basetype() != BASETYPE_TXTDOC)
return E_TYPE ;
// Grab the binary value
return m_pBR_Datum->Fetch(Z, objId) ;
}