| 458 | } |
| 459 | |
| 460 | bool CLocatorAPI::RecurseScanPhysicalPath(const char* path, const bool log_if_found, bool bNoRecurse) |
| 461 | { |
| 462 | _finddata_t sFile; |
| 463 | intptr_t hFile; |
| 464 | |
| 465 | string_path N; |
| 466 | strcpy_s(N, path); |
| 467 | strcat_s(N, "*.*"); |
| 468 | |
| 469 | using FFVec = xr_vector<_finddata_t>; |
| 470 | FFVec rec_files; |
| 471 | rec_files.reserve(1224); |
| 472 | |
| 473 | // find all files |
| 474 | if (-1 == (hFile = _findfirst(N, &sFile))) |
| 475 | { |
| 476 | // Log ("! Wrong path: ",path); |
| 477 | return false; |
| 478 | } |
| 479 | |
| 480 | if (log_if_found) |
| 481 | Msg("--Found FS dir: [%s]", path); |
| 482 | |
| 483 | string1024 full_path; |
| 484 | if (m_Flags.test(flNeedCheck)) |
| 485 | { |
| 486 | strcpy_s(full_path, path); |
| 487 | strcat_s(full_path, sFile.name); |
| 488 | |
| 489 | // загоняем в вектор для того *.db* приходили в сортированном порядке |
| 490 | if (!ignore_name(sFile.name) && !ignore_path(full_path)) |
| 491 | rec_files.push_back(sFile); |
| 492 | |
| 493 | while (_findnext(hFile, &sFile) == 0) |
| 494 | { |
| 495 | strcpy_s(full_path, path); |
| 496 | strcat_s(full_path, sFile.name); |
| 497 | if (!ignore_name(sFile.name) && !ignore_path(full_path)) |
| 498 | rec_files.push_back(sFile); |
| 499 | } |
| 500 | } |
| 501 | else |
| 502 | { |
| 503 | // загоняем в вектор для того *.db* приходили в сортированном порядке |
| 504 | if (!ignore_name(sFile.name)) |
| 505 | rec_files.push_back(sFile); |
| 506 | |
| 507 | while (_findnext(hFile, &sFile) == 0) |
| 508 | { |
| 509 | if (!ignore_name(sFile.name)) |
| 510 | rec_files.push_back(sFile); |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | _findclose(hFile); |
| 515 | |
| 516 | if (log_if_found) |
| 517 | { |
nothing calls this directly
no test coverage detected