MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / RecurseScanPhysicalPath

Method RecurseScanPhysicalPath

ogsr_engine/xrCore/LocatorAPI.cpp:460–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458}
459
460bool 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 {

Callers

nothing calls this directly

Calls 10

MsgFunction · 0.85
ignore_nameFunction · 0.85
ignore_pathFunction · 0.85
xr_strcmpFunction · 0.70
sortFunction · 0.50
reserveMethod · 0.45
testMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected