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