forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AK: Move some of LogStream out of line & add overloads for smart poin…
…ters.
- Loading branch information
1 parent
07d11a9
commit 1b013ba
Showing
9 changed files
with
87 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters