mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 12:18:25 +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:
committed by
Andreas Kling
parent
2a30a020c1
commit
055344f346
@@ -143,6 +143,11 @@ bool StringView::ends_with(const StringView& str) const
|
||||
return !memcmp(characters_without_null_termination() + length() - str.length(), str.characters_without_null_termination(), str.length());
|
||||
}
|
||||
|
||||
bool StringView::matches(const StringView& mask, CaseSensitivity case_sensitivity) const
|
||||
{
|
||||
return StringUtils::matches(*this, mask, case_sensitivity);
|
||||
}
|
||||
|
||||
StringView StringView::substring_view(size_t start, size_t length) const
|
||||
{
|
||||
ASSERT(start + length <= m_length);
|
||||
|
||||
Reference in New Issue
Block a user