|
|
@@ -20,6 +20,7 @@
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
INLINE GlobPattern::
|
|
|
GlobPattern(const string &pattern) : _pattern(pattern) {
|
|
|
+ _case_sensitive = true;
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
@@ -28,7 +29,10 @@ GlobPattern(const string &pattern) : _pattern(pattern) {
|
|
|
// Description:
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
INLINE GlobPattern::
|
|
|
-GlobPattern(const GlobPattern ©) : _pattern(copy._pattern) {
|
|
|
+GlobPattern(const GlobPattern ©) :
|
|
|
+ _pattern(copy._pattern),
|
|
|
+ _case_sensitive(copy._case_sensitive)
|
|
|
+{
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
@@ -39,6 +43,40 @@ GlobPattern(const GlobPattern ©) : _pattern(copy._pattern) {
|
|
|
INLINE void GlobPattern::
|
|
|
operator = (const GlobPattern ©) {
|
|
|
_pattern = copy._pattern;
|
|
|
+ _case_sensitive = copy._case_sensitive;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: GlobPattern::operator ==
|
|
|
+// Access: Public
|
|
|
+// Description:
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+INLINE bool GlobPattern::
|
|
|
+operator == (const GlobPattern &other) const {
|
|
|
+ return (_pattern == other._pattern && _case_sensitive == other._case_sensitive);
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: GlobPattern::operator !=
|
|
|
+// Access: Public
|
|
|
+// Description:
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+INLINE bool GlobPattern::
|
|
|
+operator != (const GlobPattern &other) const {
|
|
|
+ return !operator == (other);
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: GlobPattern::operator <
|
|
|
+// Access: Public
|
|
|
+// Description:
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+INLINE bool GlobPattern::
|
|
|
+operator < (const GlobPattern &other) const {
|
|
|
+ if (_case_sensitive != other._case_sensitive) {
|
|
|
+ return (int)_case_sensitive < (int)other._case_sensitive;
|
|
|
+ }
|
|
|
+ return _pattern < other._pattern;
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
@@ -63,6 +101,52 @@ get_pattern() const {
|
|
|
return _pattern;
|
|
|
}
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: GlobPattern::set_case_sensitive
|
|
|
+// Access: Public
|
|
|
+// Description: Sets whether the match is case sensitive (true) or
|
|
|
+// case insensitive (false). The default is case
|
|
|
+// sensitive.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+INLINE void GlobPattern::
|
|
|
+set_case_sensitive(bool case_sensitive) {
|
|
|
+ _case_sensitive = case_sensitive;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: GlobPattern::get_case_sensitive
|
|
|
+// Access: Public
|
|
|
+// Description: Returns whether the match is case sensitive (true) or
|
|
|
+// case insensitive (false). The default is case
|
|
|
+// sensitive.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+INLINE bool GlobPattern::
|
|
|
+get_case_sensitive() const {
|
|
|
+ return _case_sensitive;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: GlobPattern::set_nomatch_chars
|
|
|
+// Access: Public
|
|
|
+// Description: Specifies a set of characters that are not matched by
|
|
|
+// * or ?.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+INLINE void GlobPattern::
|
|
|
+set_nomatch_chars(const string &nomatch_chars) {
|
|
|
+ _nomatch_chars = nomatch_chars;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: GlobPattern::get_nomatch_chars
|
|
|
+// Access: Public
|
|
|
+// Description: Returns the set of characters that are not matched by
|
|
|
+// * or ?.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+INLINE const string &GlobPattern::
|
|
|
+get_nomatch_chars() const {
|
|
|
+ return _nomatch_chars;
|
|
|
+}
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GlobPattern::matches
|
|
|
// Access: Public
|