MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / filter

Function filter

utility/glob.cpp:288–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288Vector<String> filter(const Vector<String> &names,
289 const String &pattern) {
290 // std::cout << "Pattern: " << pattern << "\n";
291 Vector<String> result;
292 auto translated = Glob::translate(pattern);
293 auto re = RegEx::create_from_string(translated);
294 for (auto &name : names) {
295 // std::cout << "Checking for " << name.string() << "\n";
296 auto match = re->search(name);
297 if (match.is_valid()) {
298 result.push_back(name);
299 }
300 }
301 return result;
302}
303
304bool is_hidden(const String &pathname) {
305 return pathname[0] == '.';

Callers 1

glob1Function · 0.85

Calls 2

push_backMethod · 0.80
is_validMethod · 0.45

Tested by

no test coverage detected