Return Type | Function name | Arguments |
---|---|---|
hzEcode | hdbIndexEnum::Dump | (const hzString&,bool,) |
Declared in file: hzDatabase.h
Defined in file : hdbIndex.cpp
Function Logic:
Function body:
hzEcode hdbIndexEnum::Dump (const hzString& Filename, bool bFull) { _hzfunc("hdbIndexEnum::Dump") ; hzVect<uint32_t> Results ; ofstream os ; hzChain Z ; hdbIdset proc ; hdbIdset* pI ; uint32_t ev ; uint32_t nRecs ; uint32_t nFetched = 0; uint32_t nStart ; char cvLine [120]; if (!Filename) return hzerr(E_ARGUMENT, "No filename supplied") ; os.open(*Filename) ; if (os.fail()) return hzerr(E_OPENFAIL, "Could not open index dump file (%s)", *Filename) ; os << "Index Dump\n" ; for (ev = 0; ev < m_Maps.Count() ; ev++) { pI = m_Maps.GetObj(ev) ; if (!pI) { sprintf(cvLine, "Enum-Val %d (null list)\n", ev) ; os << cvLine ; continue ; } nRecs = pI->Count() ; if (!nRecs) { sprintf(cvLine, "Enum-Val %d (empty list)\n", ev) ; os << cvLine ; continue ; } sprintf(cvLine, "Enum-Val %d (%d objects)\n", ev, nRecs) ; os << cvLine ; if (!bFull) continue ; proc = *pI ; for (nStart = 0; nStart < nRecs ; nStart += 10) { nFetched = proc.Fetch(Results, nStart, 10); if (!nFetched) break ; sprintf(cvLine, " %10d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n", Results[0],Results[1],Results[2],Results[3],Results[4], Results[5],Results[6],Results[7],Results[8],Results[9]); os << cvLine ; } if (os.fail()) { os.close() ; hzerr(E_WRITEFAIL, "Could not write to index dump file (%s)", *Filename) ; return E_WRITEFAIL ; } } os << "Index Dump End\n" ; os.close() ; return E_OK ; }