MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / BuildMapOfArchiveIndices

Function BuildMapOfArchiveIndices

src/External/CascLib/src/CascIndexFiles.cpp:707–732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705}
706
707static DWORD BuildMapOfArchiveIndices(TCascStorage * hs)
708{
709 PCASC_EKEY_ENTRY pEKeyEntry;
710 size_t nItemCount = hs->IndexArray.ItemCount();
711 DWORD dwErrCode;
712
713 // Create the map
714 dwErrCode = hs->IndexMap.Create(nItemCount, MD5_HASH_SIZE, FIELD_OFFSET(CASC_EKEY_ENTRY, EKey));
715 if(dwErrCode != ERROR_SUCCESS)
716 return dwErrCode;
717
718 // Insert all items
719 for(size_t i = 0; i < nItemCount; i++)
720 {
721 pEKeyEntry = (PCASC_EKEY_ENTRY)hs->IndexArray.ItemAt(i);
722 if(pEKeyEntry != NULL)
723 {
724 if(!hs->IndexMap.InsertObject(pEKeyEntry, pEKeyEntry->EKey))
725 {
726 return ERROR_NOT_ENOUGH_MEMORY;
727 }
728 }
729 }
730
731 return dwErrCode;
732}
733
734static DWORD LoadArchiveIndexFiles(TCascStorage * hs)
735{

Callers 1

LoadArchiveIndexFilesFunction · 0.85

Calls 4

InsertObjectMethod · 0.80
ItemCountMethod · 0.45
CreateMethod · 0.45
ItemAtMethod · 0.45

Tested by

no test coverage detected