Add hex utility functions and refactor usage in editors
This commit is contained in:
20
src/util/hex.h
Normal file
20
src/util/hex.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef YAZE_UTIL_HEX_H
|
||||
#define YAZE_UTIL_HEX_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace yaze {
|
||||
namespace util {
|
||||
|
||||
struct HexStringParams {
|
||||
enum class Prefix { kNone, kDollar, kHash, k0x } prefix = Prefix::kDollar;
|
||||
bool uppercase = true;
|
||||
};
|
||||
|
||||
std::string HexByte(uint8_t byte, HexStringParams params = {});
|
||||
std::string HexWord(uint16_t word, HexStringParams params = {});
|
||||
std::string HexLong(uint32_t dword, HexStringParams params = {});
|
||||
std::string HexLongLong(uint64_t qword, HexStringParams params = {});
|
||||
|
||||
} // namespace util
|
||||
} // namespace yaze
|
||||
Reference in New Issue
Block a user