mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Add LogStream operator<< for ByteBuffer
This commit is contained in:
parent
b305a51c90
commit
1427c20f6a
Notes:
sideshowbarker
2024-07-19 12:09:37 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1427c20f6a2
1 changed files with 9 additions and 2 deletions
|
@ -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