mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-07 00:19:27 +00:00
AK: Add LogStream operator<< for ByteBuffer
This commit is contained in:
parent
b305a51c90
commit
1427c20f6a
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue