-
Notifications
You must be signed in to change notification settings - Fork 80
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
plFormat: a type-safe string formatter #420
Conversation
|
||
#define BADCHAR_REPLACEMENT (0xFFFDul) | ||
|
||
namespace plFormat_Private |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of namespacing everything if it's marked as file-static anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, nvm. It's not all static. Carry on
Added better documentation, and converted to doxygen format |
👍 |
{ | ||
hsAssert(*(ptr + 1), "Unterminated format specifier"); | ||
char *end = nullptr; | ||
spec.fPrecisionLeft = strtol(ptr + 1, &end, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be fPrecisionRight
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops
Something seems super funky about floating point precision specifiers, just reading through the code |
plFormat: a type-safe string formatter
Who wants to type
plString::Format("%-8s", filename.AsString().c_str())
when you can typeplFormat("{<8}", filename)
instead? :)