From 0f0f9cf3c11a233684d99ae579c55c974c43e49c Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sun, 14 Jul 2024 15:12:34 +0900 Subject: [PATCH] feat: set upper/lowercase while serialization --- include/toml11/serializer.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/toml11/serializer.hpp b/include/toml11/serializer.hpp index 43398f8..318f763 100644 --- a/include/toml11/serializer.hpp +++ b/include/toml11/serializer.hpp @@ -193,7 +193,19 @@ class serializer { case integer_format::hex: { - oss << std::setw(static_cast(fmt.width)) << std::setfill('0') << std::hex << i; + oss << std::noshowbase + << std::setw(static_cast(fmt.width)) + << std::setfill('0') + << std::hex; + if(fmt.uppercase) + { + oss << std::uppercase; + } + else + { + oss << std::nouppercase; + } + oss << i; return std::string("0x") + insert_spacer(oss.str()); } case integer_format::oct: