1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:17:35 +00:00

AK: Move the wildcard-matching implementation to StringUtils

Provide wrappers in the String and StringView classes, and add some tests.
This commit is contained in:
howar6hill 2020-02-26 15:25:24 +08:00 committed by Andreas Kling
parent 2a30a020c1
commit 055344f346
16 changed files with 147 additions and 62 deletions

View file

@ -28,6 +28,7 @@
#include <AK/Forward.h>
#include <AK/StdLibExtras.h>
#include <AK/StringUtils.h>
namespace AK {
@ -65,6 +66,7 @@ public:
bool ends_with(const StringView&) const;
bool starts_with(char) const;
bool ends_with(char) const;
bool matches(const StringView& mask, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
StringView substring_view(size_t start, size_t length) const;
Vector<StringView> split_view(char, bool keep_empty = false) const;