| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hdbBinRepos::Integ | (hzLogger&,) |
Declared in file: hzDatabase.h
Defined in file : hdbBinRepos.cpp
Function Logic:
Function body:
hzEcode hdbBinRepos::Integ (hzLogger& log)
{
_hzfunc("hdbBinRepos::Integ") ;
ifstream is ;
_datum_hd* pHd ;
_datum_hd arrHd[128];
uint32_t nBytes ;
uint32_t nItems ;
uint32_t nC ;
uint32_t totalItems = 0;
uint32_t totalSize ;
hzEcode rc = E_OK ;
if (m_nInitState < 1)
return E_NOINIT ;
is.open(*m_FileIndx) ;
if (is.fail())
return hzerr(E_OPENFAIL, "Could not open index file %s\n", *m_FileIndx) ;
for (;;)
{
is.read((char*) arrHd, 4096);
nBytes = is.gcount() ;
if (nBytes % sizeof(_datum_hd))
{
log.Log("Unexpected read size %d\n", nBytes) ;
break ;
}
nItems = nBytes/sizeof(_datum_hd) ;
for (pHd = arrHd, nC = 0; nC < nItems ; nC++, pHd++)
{
totalItems++ ;
totalSize += pHd->m_Size ;
}
if (nItems < 128)
break ;
}
is.close() ;
log.Log("Total items %u\n", totalItems) ;
log.Log("Total size %u\n", totalSize) ;
return rc ;
}