From 07d11a9b6b18f28d0e343bd7f69a091ae4b550b8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 4 Jul 2019 06:45:50 +0200 Subject: [PATCH] SharedGraphics: Add LogStream operator<<'s for Rect, Point and Size. --- SharedGraphics/Point.h | 6 ++++++ SharedGraphics/Rect.h | 6 ++++++ SharedGraphics/Size.h | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/SharedGraphics/Point.h b/SharedGraphics/Point.h index 0530da9adb2..0f3f65beb8e 100644 --- a/SharedGraphics/Point.h +++ b/SharedGraphics/Point.h @@ -1,6 +1,7 @@ #pragma once #include +#include class Rect; struct WSAPI_Point; @@ -71,3 +72,8 @@ private: int m_x { 0 }; int m_y { 0 }; }; + +inline const LogStream& operator<<(const LogStream& stream, const Point& value) +{ + return stream << value.to_string(); +} diff --git a/SharedGraphics/Rect.h b/SharedGraphics/Rect.h index 3fcc8649a1a..c9a7ededf37 100644 --- a/SharedGraphics/Rect.h +++ b/SharedGraphics/Rect.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include @@ -244,3 +245,8 @@ inline void Point::constrain(const Rect& rect) else if (y() > rect.bottom()) set_y(rect.bottom()); } + +inline const LogStream& operator<<(const LogStream& stream, const Rect& value) +{ + return stream << value.to_string(); +} diff --git a/SharedGraphics/Size.h b/SharedGraphics/Size.h index e38c47e66d2..a499dbc2fd3 100644 --- a/SharedGraphics/Size.h +++ b/SharedGraphics/Size.h @@ -1,6 +1,7 @@ #pragma once #include +#include struct WSAPI_Size; @@ -57,3 +58,8 @@ private: int m_width { 0 }; int m_height { 0 }; }; + +inline const LogStream& operator<<(const LogStream& stream, const Size& value) +{ + return stream << value.to_string(); +}