feat: add uppercase to integer fmt

for hex integer
This commit is contained in:
ToruNiina
2024-07-14 15:11:05 +09:00
parent 9fd24aa23b
commit acd6ed9a1e
2 changed files with 9 additions and 7 deletions

View File

@@ -57,6 +57,7 @@ std::string to_string(const integer_format);
struct integer_format_info struct integer_format_info
{ {
integer_format fmt = integer_format::dec; integer_format fmt = integer_format::dec;
bool uppercase = true; // hex with uppercase
std::size_t width = 0; // minimal width (may exceed) std::size_t width = 0; // minimal width (may exceed)
std::size_t spacer = 0; // position of `_` (if 0, no spacer) std::size_t spacer = 0; // position of `_` (if 0, no spacer)
std::string suffix = ""; // _suffix (library extension) std::string suffix = ""; // _suffix (library extension)

View File

@@ -67,6 +67,7 @@ TOML11_INLINE std::string to_string(const integer_format c)
TOML11_INLINE bool operator==(const integer_format_info& lhs, const integer_format_info& rhs) noexcept TOML11_INLINE bool operator==(const integer_format_info& lhs, const integer_format_info& rhs) noexcept
{ {
return lhs.fmt == rhs.fmt && return lhs.fmt == rhs.fmt &&
lhs.uppercase == rhs.uppercase &&
lhs.width == rhs.width && lhs.width == rhs.width &&
lhs.spacer == rhs.spacer && lhs.spacer == rhs.spacer &&
lhs.suffix == rhs.suffix ; lhs.suffix == rhs.suffix ;