mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Implement StringView::to_{lower,upper}case_string
This patch refactors StringImpl::to_{lower,upper}case to use the new
static methods StringImpl::create_{lower,upper}cased if they have to use
to create a new StringImpl. This allows implementing StringView's
to_{lower,upper}case_string using the same methods.
It also replaces the usage of hand-written to_ascii_lowercase() and
similar methods with those from CharacterTypes.h.
This commit is contained in:
committed by
Andreas Kling
parent
5ce9305c5f
commit
3ea65200d8
@@ -26,6 +26,9 @@ public:
|
||||
static RefPtr<StringImpl> create(const char* cstring, ShouldChomp = NoChomp);
|
||||
static RefPtr<StringImpl> create(const char* cstring, size_t length, ShouldChomp = NoChomp);
|
||||
static RefPtr<StringImpl> create(ReadonlyBytes, ShouldChomp = NoChomp);
|
||||
static RefPtr<StringImpl> create_lowercased(char const* cstring, size_t length);
|
||||
static RefPtr<StringImpl> create_uppercased(char const* cstring, size_t length);
|
||||
|
||||
NonnullRefPtr<StringImpl> to_lowercase() const;
|
||||
NonnullRefPtr<StringImpl> to_uppercase() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user