Bug 12184 – Provide formating options for std.uni.InversionList

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-16T12:52:00Z
Last change time
2014-05-04T07:59:18Z
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2014-02-16T12:52:59Z
Printing an InversionList looks like this: writefln("%s", CodepointSet('a', 'z')); => [97..122) I'd like to request that InversionList support *some* formating options, in particular, 'x' and 'X', and optionally, width. hex would be prefixed with 0x. This would allow printing as: writefln("%04x", CodepointSet('a', 'z')); => [0x0061..0x007b) This would be helpful, as codepoints are often used hex style, and not decimal style.
Comment #1 by andrej.mitrovich — 2014-02-16T12:54:20Z
This is probably easily implementable thanks to techniques like this: http://wiki.dlang.org/Defining_custom_print_format_specifiers
Comment #2 by github-bugzilla — 2014-05-04T07:59:18Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/97cdef0eefbfe9be6c22f7c95c808f90e581394e Fix Issue 12184 - Implement advanced formatting support for std.uni.InversionList. https://github.com/D-Programming-Language/phobos/commit/7872022fb17994ba5a95a82768db7385b29c0cdc Merge pull request #2126 from AndrejMitrovic/Fix12184 Issue 12184 - Implement advanced formatting support for std.uni.InversionList