diff options
author | howar6hill <f.eiwu@yahoo.com> | 2020-02-26 15:25:24 +0800 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-02 10:38:08 +0100 |
commit | 055344f3461a28578f8b49e9f2431bb9f22936b4 (patch) | |
tree | 4a39e875cef56df1950d56a2dd385898f0d000fc /AK/String.h | |
parent | 2a30a020c13e462cba6e197f92a3171d79b12ba2 (diff) | |
download | serenity-055344f3461a28578f8b49e9f2431bb9f22936b4.zip |
AK: Move the wildcard-matching implementation to StringUtils
Provide wrappers in the String and StringView classes, and add some tests.
Diffstat (limited to 'AK/String.h')
-rw-r--r-- | AK/String.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/AK/String.h b/AK/String.h index c1c381f00f..9716eabf73 100644 --- a/AK/String.h +++ b/AK/String.h @@ -29,6 +29,7 @@ #include <AK/Forward.h> #include <AK/RefPtr.h> #include <AK/StringImpl.h> +#include <AK/StringUtils.h> #include <AK/StringView.h> #include <AK/Traits.h> @@ -108,13 +109,8 @@ public: { } - enum class CaseSensitivity { - CaseInsensitive, - CaseSensitive, - }; - static String repeated(char, size_t count); - bool matches(const StringView& pattern, CaseSensitivity = CaseSensitivity::CaseInsensitive) const; + bool matches(const StringView& mask, CaseSensitivity = CaseSensitivity::CaseInsensitive) const; // FIXME: These should be shared between String and StringView somehow! int to_int(bool& ok) const; @@ -244,7 +240,6 @@ public: } private: - bool match_helper(const StringView& mask) const; RefPtr<StringImpl> m_impl; }; |