Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting integer values in hexadecimal notation #149

Open
amasciotta opened this issue Feb 1, 2021 · 1 comment
Open

Formatting integer values in hexadecimal notation #149

amasciotta opened this issue Feb 1, 2021 · 1 comment

Comments

@amasciotta
Copy link

Hello! I would like to serialize to file a toml::array. However, I would like to serialize some integers (but not all of them) contained in my data structure using the hexadecimal notation (e.g. 0xA1B2C3D4). Is there a way to do so?

More in general it would be great to have the possibility to specify a custom formatting for some of the values, using a syntax like the fmt library.

@ToruNiina
Copy link
Owner

Sorry, currently it does not have an API to do that. For an excuse, hexadecimal, octal nor binary numbers were not in the TOML spec when I started this library.
But yeah, we need to make it possible. It can be done via the serializer options or adding format-related flags in a toml::value.
These months I didn't have much spare time nor mental rest, but I think the situation will improve, hopefully. At least, I want to find a way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants