| 2446 | } |
| 2447 | |
| 2448 | static 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 | |
| 2479 | BFP_EXPORT bool BFP_CALLTYPE BfpFindFileData_FindNextFile(BfpFindFileData* findData) |
| 2480 | { |
no test coverage detected