feat(framework): add general utilities
- `addrToHex` - formats an address as a hexadecimal sring - `constAddrToHex` - const variant of `addrToHex`
This commit is contained in:
parent
6fd6df90c8
commit
6c205d476b
7
framework/include/public/toon_boom/ext/util.hpp
Normal file
7
framework/include/public/toon_boom/ext/util.hpp
Normal 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
9
framework/util.cpp
Normal 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));
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user