MCPcopy Create free account
hub / github.com/audacity/audacity / findFilesWithExt

Function findFilesWithExt

libraries/lib-vst3/module_win32.cpp:297–390  ·  view source on GitHub ↗

------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

295
296//------------------------------------------------------------------------
297void findFilesWithExt (const filesystem::path& path, const std::string& ext,
298 Module::PathList& pathList, bool recursive = true)
299{
300 for (auto& p : filesystem::directory_iterator (path))
301 {
302#if USE_FILESYSTEM
303 filesystem::path finalPath (p);
304 if (isFolderSymbolicLink (p))
305 {
306 if (auto res = resolveShellLink (p))
307 {
308 finalPath = *res;
309 if (!filesystem::exists (finalPath))
310 continue;
311 }
312 else
313 continue;
314 }
315 const auto& cpExt = finalPath.extension ();
316 if (cpExt == ext)
317 {
318 filesystem::path vstPath (finalPath);
319 if (checkVST3Package (vstPath))
320 {
321 pathList.push_back (vstPath.generic_string ());
322 continue;
323 }
324 }
325
326 if (filesystem::is_directory (finalPath))
327 {
328 if (recursive)
329 findFilesWithExt (finalPath, ext, pathList, recursive);
330 }
331 else if (cpExt == ext)
332 pathList.push_back (finalPath.generic_string ());
333#else
334 const auto& cp = p.path ();
335 const auto& cpExt = cp.extension ();
336 if (cpExt == ext)
337 {
338 if ((p.status ().type () == filesystem::file_type::directory) ||
339 isFolderSymbolicLink (p))
340 {
341 filesystem::path finalPath (p);
342 if (checkVST3Package (finalPath))
343 {
344 pathList.push_back (finalPath.generic_u8string ());
345 continue;
346 }
347 findFilesWithExt (cp, ext, pathList, recursive);
348 }
349 else
350 pathList.push_back (cp.generic_u8string ());
351 }
352 else if (recursive)
353 {
354 if (p.status ().type () == filesystem::file_type::directory)

Callers 2

findModulesFunction · 0.70
getSnapshotsMethod · 0.70

Calls 9

isFolderSymbolicLinkFunction · 0.85
resolveShellLinkFunction · 0.85
checkVST3PackageFunction · 0.85
compareMethod · 0.80
push_backMethod · 0.45
pathMethod · 0.45
typeMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected