| 900 | bool cutprefix = filter.length() == 1; |
| 901 | bool cutext = exts.length() == 1 && exts[0][0] != '.'; |
| 902 | loopv(files) |
| 903 | { |
| 904 | char *f = files[i] + pn; |
| 905 | const char *p = parentdir(f), *b = behindpath(f); |
| 906 | cvecprintf(res, "\"%s\" \"%s\"", p, b); // always add columns for path (without "packages/textures/") and filename |
| 907 | if(cutprefix) cvecprintf(res, " \"%s\"", int(strlen(p)) > filter_n[0] ? p + filter_n[0] : ""); // if there's exactly one filter string, add column with that string omitted |
| 908 | if(cutext) |
| 909 | { |
| 910 | int n = strlen(b); |
| 911 | if(n > exts_n[0]) ((char *)b)[n - exts_n[0]] = '\0'; |
| 912 | cvecprintf(res, " \"%s\"", b); // if there's only one allowed extension and it does not start with '.', add column of filenames without extension |
| 913 | } |
| 914 | res.add('\n'); |
| 915 | } |
| 916 | filter.deletearrays(); |
| 917 | exclude.deletearrays(); |
| 918 | exts.deletearrays(); |
no test coverage detected