AK: Add LogStream operator<< for ByteBuffer

This commit is contained in:
Andreas Kling 2019-09-11 19:35:14 +02:00
parent b305a51c90
commit 1427c20f6a

View file

@ -1,10 +1,11 @@
#pragma once
#include "StdLibExtras.h"
#include "Types.h"
#include <AK/LogStream.h>
#include <AK/NonnullRefPtr.h>
#include <AK/RefCounted.h>
#include <AK/RefPtr.h>
#include <AK/StdLibExtras.h>
#include <AK/Types.h>
#include <AK/kmalloc.h>
namespace AK {
@ -272,6 +273,12 @@ inline NonnullRefPtr<ByteBufferImpl> 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;