3
* Filter strings based on globbed exclude/include list
5
* @remark Copyright 2002 OProfile authors
6
* @remark Read the file COPYING
8
* @author Philippe Elie
15
#include "string_filter.h"
18
* glob_filter - filtering of a string based on globbed include/exclude list
20
* This class is an oracle on whether a particular string matches
21
* the given list of included and excluded strings.
23
* This class gives glob-based matches on each pattern, as with fnmatch(3)
25
class glob_filter : public string_filter {
28
* Initialise the filter with the include and exclude list,
31
glob_filter(std::string const & include_patterns,
32
std::string const & exclude_patterns)
33
: string_filter(include_patterns, exclude_patterns) {}
36
* Initialise the filter with the include and exclude list.
38
glob_filter(std::vector<std::string> const & include_patterns,
39
std::vector<std::string> const & exclude_patterns)
40
: string_filter(include_patterns, exclude_patterns) {}
42
/// Returns true if the given string matches
43
virtual bool match(std::string const & str) const;
47
/// function object for fnmatching
49
fnmatcher(std::string const & str) : str_(str) {}
51
bool operator()(std::string const & s);
53
std::string const & str_;
57
#endif /* GLOB_FILTER_H */