MCPcopy Create free account
hub / github.com/assaultcube/AC / listfiles

Function listfiles

source/src/stream.cpp:416–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416void listfiles(const char *dir, const char *ext, vector<char *> &files, int (__cdecl *sf)(const char **, const char **))
417{
418 listdir(dir, ext, files);
419 string s;
420 if(homedir[0])
421 {
422 formatstring(s)("%s%s", homedir, dir);
423 listdir(s, ext, files);
424 }
425 loopv(packagedirs)
426 {
427 formatstring(s)("%s%s", packagedirs[i], dir);
428 listdir(s, ext, files);
429 }
430#ifndef STANDALONE
431 listzipfiles(dir, ext, files);
432#endif
433 if(sf)
434 { // sort and remove doubles
435 files.sort(sf);
436 for(int i = files.length() - 1; i > 0; i--)
437 {
438 if(!strcmp(files[i], files[i - 1])) delstring(files.remove(i));
439 }
440 }
441}
442
443#ifndef STANDALONE
444void listfilesrecursive(const char *dir, vector<char *> &files, int level)

Callers 12

readmapsthreadFunction · 0.85
listfilesrecursiveFunction · 0.85
updateclientnameFunction · 0.85
initMethod · 0.85
loadcertdirFunction · 0.85
updateigraphsFunction · 0.85
commandcompleteFunction · 0.85
execdirFunction · 0.85
enumfilesFunction · 0.85
loadallxmapsFunction · 0.85
rndmapnameFunction · 0.85
autostartscriptsFunction · 0.85

Calls 6

listdirFunction · 0.85
listzipfilesFunction · 0.85
delstringFunction · 0.85
sortMethod · 0.80
lengthMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected