mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
26 lines
572 B
Text
26 lines
572 B
Text
// assuming we're in g_cwd, all entries of type 'type' matching source/pattern
|
|
// are returned w/o final \n
|
|
|
|
list findAll(string type, string source, string pattern)
|
|
{
|
|
string cmd;
|
|
list entries;
|
|
list ret;
|
|
int idx;
|
|
|
|
chdir(source);
|
|
|
|
cmd = "find ./ -mindepth 1 -maxdepth 1 -type " + type;
|
|
|
|
if (pattern != "")
|
|
pattern = "-name '" + pattern + "'";
|
|
|
|
entries = backtick(cmd + " " + pattern + " -printf \"%f\\n\"");
|
|
|
|
for (idx = listlen(entries); idx--; )
|
|
ret += (list)cutEoln(entries[idx]);
|
|
|
|
chdir(g_cwd);
|
|
|
|
return ret;
|
|
}
|