mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 03:18:11 +00:00
AK: Move some of LogStream out of line & add overloads for smart pointers.
This commit is contained in:
parent
07d11a9b6b
commit
1b013ba699
9 changed files with 87 additions and 31 deletions
34
AK/LogStream.cpp
Normal file
34
AK/LogStream.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include <AK/AKString.h>
|
||||
#include <AK/LogStream.h>
|
||||
#include <AK/StringView.h>
|
||||
|
||||
namespace AK {
|
||||
|
||||
inline const LogStream& operator<<(const LogStream& stream, const String& value)
|
||||
{
|
||||
stream.write(value.characters(), value.length());
|
||||
return stream;
|
||||
}
|
||||
|
||||
inline const LogStream& operator<<(const LogStream& stream, const StringView& value)
|
||||
{
|
||||
stream.write(value.characters(), value.length());
|
||||
return stream;
|
||||
}
|
||||
|
||||
const LogStream& operator<<(const LogStream& stream, int value)
|
||||
{
|
||||
return stream << String::number(value);
|
||||
}
|
||||
|
||||
const LogStream& operator<<(const LogStream& stream, unsigned value)
|
||||
{
|
||||
return stream << String::number(value);
|
||||
}
|
||||
|
||||
const LogStream& operator<<(const LogStream& stream, const void* value)
|
||||
{
|
||||
return stream << String::format("%p", value);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue