1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

LibCore: Add AllocatingMemoryStream::offset_of

This commit is contained in:
Tim Schumacher 2023-01-13 13:41:14 +01:00 committed by Ali Mohammad Pur
parent ecc202c59d
commit 156b6e83cd
3 changed files with 76 additions and 0 deletions

View file

@ -60,6 +60,8 @@ public:
size_t used_buffer_size() const;
ErrorOr<Optional<size_t>> offset_of(ReadonlyBytes needle) const;
private:
// Note: We set the inline buffer capacity to zero to make moving chunks as efficient as possible.
using Chunk = AK::Detail::ByteBuffer<0>;