SCAN_CODE ScanTree::GetNext(FindData *FindData) { if (Depth<0) return(SCAN_DONE); SCAN_CODE FindCode; while (1) { if (*CurMask==0 && !GetNextMask()) return(SCAN_DONE); FindCode=FindProc(FindData); if (FindCode==SCAN_ERROR) { Errors++; continue; } if (FindCode==SCAN_NEXT) continue; if (FindCode==SCAN_SUCCESS && FindData->IsDir && GetDirs==SCAN_SKIPDIRS) continue; if (FindCode==SCAN_DONE && GetNextMask()) continue; break; } return(FindCode); }
SCAN_CODE ScanTree::GetNext(FindData *FD) { if (Depth<0) return SCAN_DONE; #ifndef SILENT uint LoopCount=0; #endif SCAN_CODE FindCode; while (1) { if (*CurMask==0 && !GetNextMask()) return SCAN_DONE; #ifndef SILENT // Let's return some ticks to system or WinRAR can become irresponsible // while scanning files in command like "winrar a -r arc c:\file.ext". // Also we reset system sleep timer here. if ((++LoopCount & 0x3ff)==0) Wait(); #endif FindCode=FindProc(FD); if (FindCode==SCAN_ERROR) { Errors++; continue; } if (FindCode==SCAN_NEXT) continue; if (FindCode==SCAN_SUCCESS && FD->IsDir && GetDirs==SCAN_SKIPDIRS) continue; if (FindCode==SCAN_DONE && GetNextMask()) continue; if (FilterList.ItemsCount()>0 && FindCode==SCAN_SUCCESS) if (!CommandData::CheckArgs(&FilterList,FD->IsDir,FD->Name,false,MATCH_WILDSUBPATH)) continue; break; } return FindCode; }