mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
AK: Add ByteBuffer::append(char)
This commit is contained in:
parent
22b3c25f10
commit
ad2551e6b8
1 changed files with 10 additions and 0 deletions
|
@ -182,6 +182,11 @@ public:
|
||||||
return try_ensure_capacity_slowpath(new_capacity);
|
return try_ensure_capacity_slowpath(new_capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void append(char byte)
|
||||||
|
{
|
||||||
|
MUST(try_append(byte));
|
||||||
|
}
|
||||||
|
|
||||||
void append(ReadonlyBytes bytes)
|
void append(ReadonlyBytes bytes)
|
||||||
{
|
{
|
||||||
MUST(try_append(bytes));
|
MUST(try_append(bytes));
|
||||||
|
@ -189,6 +194,11 @@ public:
|
||||||
|
|
||||||
void append(void const* data, size_t data_size) { append({ data, data_size }); }
|
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)
|
ErrorOr<void> try_append(ReadonlyBytes bytes)
|
||||||
{
|
{
|
||||||
return try_append(bytes.data(), bytes.size());
|
return try_append(bytes.data(), bytes.size());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue