mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 02:26:11 +00:00
AK: Add ByteBuffer::append(char)
This commit is contained in:
parent
22b3c25f10
commit
ad2551e6b8
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue