AK: Make String::matches() capable of reporting match positions too

Also, rewrite StringUtils::match(), because the old implementation was
fairly broken, e.g. "acdcxb" would *not* match "a*?b".
This commit is contained in:
AnotherTest 2020-10-25 09:04:39 +03:30 committed by Andreas Kling
parent 2d6d1ca67f
commit 0801b1fada
Notes: sideshowbarker 2024-07-19 01:39:37 +09:00
7 changed files with 86 additions and 33 deletions

View file

@ -87,6 +87,7 @@ public:
bool starts_with(char) const;
bool ends_with(char) const;
bool matches(const StringView& mask, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
bool matches(const StringView& mask, Vector<MaskSpan>&, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
bool contains(char) const;
bool contains(const StringView&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
bool equals_ignoring_case(const StringView& other) const;