mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-02-18 02:05:39 +00:00
Hex formatting support extended to 64 bits.
This commit is contained in:
parent
61a0517bd9
commit
98b0354dd6
|
@ -41,7 +41,7 @@ namespace Util
|
||||||
|
|
||||||
static const char hex_digits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
static const char hex_digits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||||
|
|
||||||
std::string Hex(uint32_t n, size_t num_digits)
|
std::string Hex(uint64_t n, size_t num_digits)
|
||||||
{
|
{
|
||||||
Util::Format f;
|
Util::Format f;
|
||||||
f << "0x";
|
f << "0x";
|
||||||
|
@ -53,6 +53,11 @@ namespace Util
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Hex(uint64_t n)
|
||||||
|
{
|
||||||
|
return Hex(n, 16);
|
||||||
|
}
|
||||||
|
|
||||||
std::string Hex(uint32_t n)
|
std::string Hex(uint32_t n)
|
||||||
{
|
{
|
||||||
return Hex(n, 8);
|
return Hex(n, 8);
|
||||||
|
|
|
@ -95,7 +95,8 @@ namespace Util
|
||||||
std::ostream &operator<<(std::ostream &os, const Format &format);
|
std::ostream &operator<<(std::ostream &os, const Format &format);
|
||||||
std::string ToLower(const std::string &str);
|
std::string ToLower(const std::string &str);
|
||||||
std::string TrimWhiteSpace(const std::string &str);
|
std::string TrimWhiteSpace(const std::string &str);
|
||||||
std::string Hex(uint32_t n, size_t num_digits);
|
std::string Hex(uint64_t n, size_t num_digits);
|
||||||
|
std::string Hex(uint64_t n);
|
||||||
std::string Hex(uint32_t n);
|
std::string Hex(uint32_t n);
|
||||||
std::string Hex(uint16_t n);
|
std::string Hex(uint16_t n);
|
||||||
std::string Hex(uint8_t n);
|
std::string Hex(uint8_t n);
|
||||||
|
|
Loading…
Reference in a new issue