feat(framework): add general utilities

- `addrToHex` - formats an address as a hexadecimal sring
- `constAddrToHex` - const variant of `addrToHex`
This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2026-01-14 23:45:26 -05:00
parent 6fd6df90c8
commit 6c205d476b
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#pragma once
#include <format>
std::string addrToHex(void* addr);
std::string constAddrToHex(const void* addr);

9
framework/util.cpp Normal file
View File

@ -0,0 +1,9 @@
#include "include/public/toon_boom/ext/util.hpp"
std::string addrToHex(void* addr) {
return std::format("0x{:010X}", reinterpret_cast<uintptr_t>(addr));
}
std::string constAddrToHex(const void* addr) {
return std::format("0x{:010X}", reinterpret_cast<const uintptr_t>(addr));
}