MCPcopy Create free account
hub / github.com/beefytech/Beef / BfpFindFileData_CheckFilter

Function BfpFindFileData_CheckFilter

BeefySysLib/platform/posix/PosixCommon.cpp:2448–2477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2446}
2447
2448static bool BfpFindFileData_CheckFilter(BfpFindFileData* findData)
2449{
2450 bool isDir = false;
2451 if (findData->mDirEnt->d_type == DT_DIR)
2452 isDir = true;
2453 if (findData->mDirEnt->d_type == DT_LNK)
2454 {
2455 GetStat(findData);
2456 isDir = S_ISDIR(findData->mStat.st_mode);
2457 }
2458
2459 if (isDir)
2460 {
2461 if ((findData->mFlags & BfpFindFileFlag_Directories) == 0)
2462 return false;
2463
2464 if ((strcmp(findData->mDirEnt->d_name, ".") == 0) || (strcmp(findData->mDirEnt->d_name, "..") == 0))
2465 return false;
2466 }
2467 else
2468 {
2469 if ((findData->mFlags & BfpFindFileFlag_Files) == 0)
2470 return false;
2471 }
2472
2473 if (!wc_match(findData->mWildcard.c_str(), findData->mDirEnt->d_name))
2474 return false;
2475
2476 return true;
2477}
2478
2479BFP_EXPORT bool BFP_CALLTYPE BfpFindFileData_FindNextFile(BfpFindFileData* findData)
2480{

Callers 1

Calls 2

GetStatFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected