MCPcopy Index your code
hub / github.com/assaultcube/AC / listfilesrecursive

Function listfilesrecursive

source/src/stream.cpp:444–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442
443#ifndef STANDALONE
444void listfilesrecursive(const char *dir, vector<char *> &files, int level)
445{
446 if(level > 8) return; // 8 levels is insane enough...
447 vector<char *> dirs, thisdir;
448 listsubdirs(dir, dirs, stringsort);
449 loopv(dirs)
450 {
451 if(dirs[i][0] != '.') // ignore "." and ".." (and also other directories starting with '.', like it is unix-convention - and doesn't hurt on windows)
452 {
453 defformatstring(name)("%s/%s", dir, dirs[i]);
454 listfilesrecursive(name, files, level + 1);
455 }
456 delstring(dirs[i]);
457 }
458 listfiles(dir, NULL, thisdir);
459 loopv(thisdir)
460 {
461 defformatstring(name)("%s/%s", dir, thisdir[i]);
462 files.add(newstring(name));
463 delstring(thisdir[i]);
464 }
465}
466
467void listdirsrecursive(const char *dir, vector<char *> &subdirs, int level)
468{

Callers 4

gettexturelistFunction · 0.85
loopvFunction · 0.85
zipmodlistFunction · 0.85
getmapsoundlistFunction · 0.85

Calls 2

listsubdirsFunction · 0.85
listfilesFunction · 0.85

Tested by

no test coverage detected