18GlobPattern(
const std::string &pattern) : _pattern(pattern) {
19 _case_sensitive =
true;
27 _pattern(copy._pattern),
28 _case_sensitive(copy._case_sensitive)
35INLINE
void GlobPattern::
37 _pattern = copy._pattern;
38 _case_sensitive = copy._case_sensitive;
44INLINE
bool GlobPattern::
46 return (_pattern == other._pattern && _case_sensitive == other._case_sensitive);
52INLINE
bool GlobPattern::
54 return !operator == (other);
60INLINE
bool GlobPattern::
62 if (_case_sensitive != other._case_sensitive) {
63 return (
int)_case_sensitive < (int)other._case_sensitive;
65 return _pattern < other._pattern;
90 _case_sensitive = case_sensitive;
99 return _case_sensitive;
107 _nomatch_chars = nomatch_chars;
115 return _nomatch_chars;
122matches(
const std::string &candidate)
const {
123 return matches_substr(_pattern.begin(), _pattern.end(),
124 candidate.begin(), candidate.end());
130INLINE
void GlobPattern::
131output(std::ostream &out)
const {
This class can be used to test for string matches against standard Unix- shell filename globbing conv...
get_case_sensitive
Returns whether the match is case sensitive (true) or case insensitive (false).
set_pattern
Changes the pattern string that the GlobPattern object matches.
get_pattern
Returns the pattern string that the GlobPattern object matches.
bool matches(const std::string &candidate) const
Returns true if the candidate string matches the pattern, false otherwise.
set_nomatch_chars
Specifies a set of characters that are not matched by * or ?.
get_nomatch_chars
Returns the set of characters that are not matched by * or ?.
set_case_sensitive
Sets whether the match is case sensitive (true) or case insensitive (false).