mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:44:58 +00:00
AK: Add String constructor from ReadonlyBytes.
This commit is contained in:
parent
42b4880653
commit
75cde94c6a
3 changed files with 23 additions and 0 deletions
|
@ -133,6 +133,11 @@ RefPtr<StringImpl> StringImpl::create(const char* cstring, ShouldChomp shouldCho
|
|||
return create(cstring, strlen(cstring), shouldChomp);
|
||||
}
|
||||
|
||||
RefPtr<StringImpl> StringImpl::create(ReadonlyBytes bytes, ShouldChomp shouldChomp)
|
||||
{
|
||||
return StringImpl::create(reinterpret_cast<const char*>(bytes.data()), bytes.size(), shouldChomp);
|
||||
}
|
||||
|
||||
static inline bool is_ascii_lowercase(char c)
|
||||
{
|
||||
return c >= 'a' && c <= 'z';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue