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

plFormat: a type-safe string formatter #420

Merged
merged 8 commits into from
May 21, 2014
Merged

plFormat: a type-safe string formatter #420

merged 8 commits into from
May 21, 2014

Conversation

zrax
Copy link
Member

@zrax zrax commented May 16, 2014

Who wants to type plString::Format("%-8s", filename.AsString().c_str()) when you can type plFormat("{<8}", filename) instead? :)


#define BADCHAR_REPLACEMENT (0xFFFDul)

namespace plFormat_Private
Copy link
Member

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?

Copy link
Member

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

@zrax
Copy link
Member Author

zrax commented May 18, 2014

Added better documentation, and converted to doxygen format

@Hoikas
Copy link
Member

Hoikas commented May 19, 2014

👍

{
hsAssert(*(ptr + 1), "Unterminated format specifier");
char *end = nullptr;
spec.fPrecisionLeft = strtol(ptr + 1, &end, 10);
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

@branan
Copy link
Member

branan commented May 19, 2014

Something seems super funky about floating point precision specifiers, just reading through the code

Hoikas added a commit that referenced this pull request May 21, 2014
plFormat: a type-safe string formatter
@Hoikas Hoikas merged commit c9c7350 into H-uru:master May 21, 2014
@zrax zrax deleted the plFormat branch May 21, 2014 02:53
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

Successfully merging this pull request may close these issues.

None yet

3 participants