mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Add LogStream operator<< for ByteBuffer
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user