| 442 | |
| 443 | #ifndef STANDALONE |
| 444 | void 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 | |
| 467 | void listdirsrecursive(const char *dir, vector<char *> &subdirs, int level) |
| 468 | { |
no test coverage detected