diff options
author | Max Horn | 2009-02-15 18:45:53 +0000 |
---|---|---|
committer | Max Horn | 2009-02-15 18:45:53 +0000 |
commit | 17014c4f472a2325fa75b4a14cf1acace3464020 (patch) | |
tree | addbed679aa0bda665949779e273cae12732109c /common/str.h | |
parent | 544bda60faa33baec0517155b68879536fe0d829 (diff) | |
download | scummvm-rg350-17014c4f472a2325fa75b4a14cf1acace3464020.tar.gz scummvm-rg350-17014c4f472a2325fa75b4a14cf1acace3464020.tar.bz2 scummvm-rg350-17014c4f472a2325fa75b4a14cf1acace3464020.zip |
Merged internal 'matchPath' method of class Archive into global matchString function (via an optional 'path mode' in the latter). Also changed Archive::listMatchingMembers to use path mode when matching, just like FSDirectory::listMatchingMembers
svn-id: r38277
Diffstat (limited to 'common/str.h')
-rw-r--r-- | common/str.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/common/str.h b/common/str.h index 43b75edc5b..b9b269468f 100644 --- a/common/str.h +++ b/common/str.h @@ -166,11 +166,12 @@ public: * * @param str Text to be matched against the given pattern. * @param pat Glob pattern. + * @param pathMode Whether to use path mode, i.e., whether slashes must be matched explicitly. * * @return true if str matches the pattern, false otherwise. */ - bool matchString(const char *pat) const; - bool matchString(const String &pat) const; + bool matchString(const char *pat, bool pathMode = false) const; + bool matchString(const String &pat, bool pathMode = false) const; inline const char *c_str() const { return _str; } @@ -306,10 +307,11 @@ Common::String normalizePath(const Common::String &path, const char sep); * * @param str Text to be matched against the given pattern. * @param pat Glob pattern. + * @param pathMode Whether to use path mode, i.e., whether slashes must be matched explicitly. * * @return true if str matches the pattern, false otherwise. */ -bool matchString(const char *str, const char *pat); +bool matchString(const char *str, const char *pat, bool pathMode = false); class StringList : public Array<String> { |