1 #ifndef __libmisc_pathscanner_h__
2 #define __libmisc_pathscanner_h__
15 vector<string *> *operator() (const string &dirpath,
16 bool (*filter)(const string &, void *arg),
18 bool match_fullpath = true,
19 bool return_fullpath = true,
21 return run_scan (dirpath,
22 (bool (PathScanner::*)(const string &)) 0,
30 vector<string *> *operator() (const string &dirpath,
32 bool match_fullpath = true,
33 bool return_fullpath = true,
37 string *find_first (const string &dirpath,
39 bool match_fullpath = true,
40 bool return_fullpath = true);
42 string *find_first (const string &dirpath,
43 bool (*filter)(const string &, void *),
45 bool match_fullpath = true,
46 bool return_fullpath = true);
49 regex_t compiled_pattern;
51 bool regexp_filter (const string &str) {
52 return regexec (&compiled_pattern, str.c_str(), 0, 0, 0) == 0;
55 vector<string *> *run_scan (const string &dirpath,
56 bool (PathScanner::*mfilter) (const string &),
57 bool (*filter)(const string &, void *),
66 #endif // __libmisc_pathscanner_h__