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

Expose or extract useful utilities? #323

Closed
netheril96 opened this issue May 12, 2016 · 4 comments
Closed

Expose or extract useful utilities? #323

netheril96 opened this issue May 12, 2016 · 4 comments

Comments

@netheril96
Copy link

This library contains more than the awesome formatting capabilities. It also has UTF8 to UTF16 conversion, cross platform strerror_r, detection of compiler features, etc. Can you expose them as public functions? Or extract them into a separate library?

@vitaut
Copy link
Contributor

vitaut commented May 12, 2016

Thanks for the feedback.

System error API is already public: http://fmtlib.net/latest/api.html#system-errors. I don't think it's a good idea to expose strerror_r-like API because it requires awkward buffer management. Does the system error API work for you or are you looking for something else?

I'll be happy to make UTF-8/UTF-16 converters public, but note that they are only implemented for Windows, because other platforms support UTF-8 natively. The converters need to be documented first though.

@netheril96
Copy link
Author

I have my own exception hierarchy so I don't want to construct a fmt::SystemError. strerror_r is indeed awkward, so an better API would be just std::string fmt::system_errmsg(int). Or with some better name.

@vitaut
Copy link
Contributor

vitaut commented May 12, 2016

format_system_error is in the public API as of 9c78098.

@netheril96
Copy link
Author

Thanks!

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