toml11
toml11 copied to clipboard
Preserve hex number format
I'd like to preserve the parsed format for integral numbers, like num=0x1234
should output num=0x1234
I don't see any support for this, would like to implement it, what would be a good way to do it?
From my understanding the TOML specification requires parsing such numbers. Would it not be easier to wrap it in quotes? num="0x1234"?
I have released v4.0.0 and now you can set integer_format::hex
.
toml::value v(0xC0FFEE);
v.as_integer_fmt().fmt = toml::integer_format::hex;
v.as_integer_fmt().spacer = 4; // 0xc0_ffee
v.as_integer_fmt().width = 8; // 0x00c0_ffee
These parameters are also parsed from a file. You can now preserve these format information.