Poco::format() doesn't support (space) as a flag like printf() does
printf() supports a space ' ' as a flag in the format specifier. It would be great if Poco::format() supported the same.
http://www.cplusplus.com/reference/cstdio/printf/ https://github.com/pocoproject/poco/blob/1bf40a0cd28be83e6243a0524be19118792c8cd1/Foundation/src/Format.cpp#L30
This issue is stale because it has been open for 365 days with no activity.
This issue has been open for over two and a half years. Is there any chance of addressing this issue?
This issue is stale because it has been open for 365 days with no activity.
This issue has been open for over three years? Would it be possible for someone to address this issue?
This issue is stale because it has been open for 365 days with no activity.
@austin-beer, is this stil an issue in Poco 1.13?
If so, can you prepare a fix and create a pull request?
Yes, this is still an issue in Poco 1.13. This switch statement still doesn't handle a space character in the format string: https://github.com/pocoproject/poco/blob/poco-1.13.0-release/Foundation/src/Format.cpp#L35
Unfortunately I don't have time right now to develop a fix for this, but I'll put it on my TODO list to work on if I get time.
Poco::format wraps the C++ streams which don't have an equivalent for this flag. That makes this a pretty difficult feature to implement in Poco. Simply adding a space to that switch isn't going to cut it.
Ah, yes, I didn't realize that. It does make implementing this capability more difficult. Perhaps instead then an exception should be thrown if ' ' is encountered as a format flag so that the un-expected behavior (that it's not supported) is clear to anyone who tries to use it.