AK: Add ByteBuffer::append(char)

This commit is contained in:
Maciej 2022-01-04 17:08:29 +01:00 committed by Andreas Kling
parent 22b3c25f10
commit ad2551e6b8

View file

@ -182,6 +182,11 @@ public:
return try_ensure_capacity_slowpath(new_capacity);
}
void append(char byte)
{
MUST(try_append(byte));
}
void append(ReadonlyBytes bytes)
{
MUST(try_append(bytes));
@ -189,6 +194,11 @@ public:
void append(void const* data, size_t data_size) { append({ data, data_size }); }
ErrorOr<void> try_append(char byte)
{
return try_append(&byte, 1);
}
ErrorOr<void> try_append(ReadonlyBytes bytes)
{
return try_append(bytes.data(), bytes.size());