From 6c205d476b3c5c8c1fd3ca8ff593838c45391126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Wed, 14 Jan 2026 23:45:26 -0500 Subject: [PATCH] feat(framework): add general utilities - `addrToHex` - formats an address as a hexadecimal sring - `constAddrToHex` - const variant of `addrToHex` --- framework/include/public/toon_boom/ext/util.hpp | 7 +++++++ framework/util.cpp | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 framework/include/public/toon_boom/ext/util.hpp create mode 100644 framework/util.cpp diff --git a/framework/include/public/toon_boom/ext/util.hpp b/framework/include/public/toon_boom/ext/util.hpp new file mode 100644 index 0000000..3159b4a --- /dev/null +++ b/framework/include/public/toon_boom/ext/util.hpp @@ -0,0 +1,7 @@ +#pragma once + +#include + +std::string addrToHex(void* addr); + +std::string constAddrToHex(const void* addr); \ No newline at end of file diff --git a/framework/util.cpp b/framework/util.cpp new file mode 100644 index 0000000..06980f9 --- /dev/null +++ b/framework/util.cpp @@ -0,0 +1,9 @@ +#include "include/public/toon_boom/ext/util.hpp" + +std::string addrToHex(void* addr) { + return std::format("0x{:010X}", reinterpret_cast(addr)); +} + +std::string constAddrToHex(const void* addr) { + return std::format("0x{:010X}", reinterpret_cast(addr)); +} \ No newline at end of file