From a39395cd129656acc4852e94846e35e5f687149f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Quei=C3=9Fner?= Date: Wed, 4 May 2016 15:49:55 +0200 Subject: [PATCH] Adds support for pointer types to console. --- prototypes/base/include/console.hpp | 4 ++++ prototypes/base/src/console.cpp | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/prototypes/base/include/console.hpp b/prototypes/base/include/console.hpp index 6c6f394..188b5c0 100644 --- a/prototypes/base/include/console.hpp +++ b/prototypes/base/include/console.hpp @@ -1,6 +1,7 @@ #pragma once #include "screen.hpp" +#include "pointer.hpp" struct FColor { @@ -119,4 +120,7 @@ public: Console & operator << (void *value); Console & operator << (bool value); + + template + Console & operator << (pointer ptr); }; \ No newline at end of file diff --git a/prototypes/base/src/console.cpp b/prototypes/base/src/console.cpp index 99326c7..bf9b391 100644 --- a/prototypes/base/src/console.cpp +++ b/prototypes/base/src/console.cpp @@ -141,4 +141,19 @@ Console & Console::operator << (bool value) *this << "false"; } return *this; +} + + +template<> +Console & Console::operator << (physical_t ptr) +{ + *this << "physical(0x" << ptr.data() << ")"; + return *this; +} + +template<> +Console & Console::operator << (virtual_t ptr) +{ + *this << "virtual(0x" << ptr.data() << ")"; + return *this; } \ No newline at end of file