From 1427c20f6a2a9a445458d43dfa312e062a1d0718 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 11 Sep 2019 19:35:14 +0200 Subject: [PATCH] AK: Add LogStream operator<< for ByteBuffer --- AK/ByteBuffer.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h index f86a709831..3743397d51 100644 --- a/AK/ByteBuffer.h +++ b/AK/ByteBuffer.h @@ -1,10 +1,11 @@ #pragma once -#include "StdLibExtras.h" -#include "Types.h" +#include #include #include #include +#include +#include #include namespace AK { @@ -272,6 +273,12 @@ inline NonnullRefPtr ByteBufferImpl::adopt(void* data, int size) return ::adopt(*new ByteBufferImpl(data, size, Adopt)); } +inline const LogStream& operator<<(const LogStream& stream, const ByteBuffer& value) +{ + stream.write((const char*)value.data(), value.size()); + return stream; +} + } using AK::ByteBuffer;