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

Function DoStorageSearch_CKey

src/External/CascLib/src/CascFindFile.cpp:127–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127static bool DoStorageSearch_CKey(TCascSearch * pSearch, PCASC_FIND_DATA pFindData)
128{
129 PCASC_CKEY_ENTRY pCKeyEntry;
130 TCascStorage * hs = pSearch->hs;
131 size_t nTotalItems = hs->CKeyArray.ItemCount();
132
133 // Reset the find data structure
134 ResetFindData(pFindData);
135
136 // Check for CKeys that haven't been found yet
137 while(pSearch->nFileIndex < nTotalItems)
138 {
139 // Locate the n-th CKey entry.
140 pCKeyEntry = (PCASC_CKEY_ENTRY)hs->CKeyArray.ItemAt(pSearch->nFileIndex++);
141 //BREAK_ON_XKEY3(pCKeyEntry->CKey, 0x2B, 0xfc, 0xe4);
142
143 // Only report files that are unreferenced by the ROOT handler
144 if(pCKeyEntry->IsFile() && pCKeyEntry->RefCount == 0)
145 {
146 return CopyCKeyEntryToFindData(pFindData, pCKeyEntry);
147 }
148 }
149
150 // Nameless search ended
151 return false;
152}
153
154static bool DoStorageSearch(TCascSearch * pSearch, PCASC_FIND_DATA pFindData)
155{

Callers 1

DoStorageSearchFunction · 0.85

Calls 5

ResetFindDataFunction · 0.85
CopyCKeyEntryToFindDataFunction · 0.85
IsFileMethod · 0.80
ItemCountMethod · 0.45
ItemAtMethod · 0.45

Tested by

no test coverage detected