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

Function loopv

source/src/texture.cpp:902–915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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();

Callers 7

gettexturelistFunction · 0.70
textureslotusageFunction · 0.70
deletetextureslotFunction · 0.70
textureslotbynameFunction · 0.70
texconfig_copyFunction · 0.70
sorttextureslotsFunction · 0.70

Calls 8

parentdirFunction · 0.85
behindpathFunction · 0.85
cvecprintfFunction · 0.85
_textureFunction · 0.85
loopvjFunction · 0.70
addMethod · 0.45
removeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected