mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:57:45 +00:00
AK: Add LogStream operator<< for ByteBuffer
This commit is contained in:
parent
b305a51c90
commit
1427c20f6a
1 changed files with 9 additions and 2 deletions
|
@ -1,10 +1,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "StdLibExtras.h"
|
#include <AK/LogStream.h>
|
||||||
#include "Types.h"
|
|
||||||
#include <AK/NonnullRefPtr.h>
|
#include <AK/NonnullRefPtr.h>
|
||||||
#include <AK/RefCounted.h>
|
#include <AK/RefCounted.h>
|
||||||
#include <AK/RefPtr.h>
|
#include <AK/RefPtr.h>
|
||||||
|
#include <AK/StdLibExtras.h>
|
||||||
|
#include <AK/Types.h>
|
||||||
#include <AK/kmalloc.h>
|
#include <AK/kmalloc.h>
|
||||||
|
|
||||||
namespace AK {
|
namespace AK {
|
||||||
|
@ -272,6 +273,12 @@ inline NonnullRefPtr<ByteBufferImpl> ByteBufferImpl::adopt(void* data, int size)
|
||||||
return ::adopt(*new ByteBufferImpl(data, size, Adopt));
|
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;
|
using AK::ByteBuffer;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue