Thanks! Padding looks like what the doctor ordered. However I'm concerned with upper/lower directives. What is needed in hex is a simple mapping for 6 letters from a..z to A..Z and vice versa. Upper/lower, I guess, will employ std::locale to work properly which in turn uses std::facet which (at least in Windows) has lazy initialization and protected by CriticalSection. This is a performance killer, I've just spent two weeks getting rid of these from my code. Now tell me that I'm wrong and these directives do not use std::locale and I will be happy for the rest of my life :) Otherwise I would like to know if there is another possibility to control hex letter case -----Original Message----- From: Boost-users [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Hartmut Kaiser Sent: Sunday, April 19, 2015 4:23 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Boost Spirit Karma - convert character to hex representation
There is karma::hex formatter and I need somehow to add zero padding to get “0a” instead of just “a”. in addition it would be lovely to have some king of control over hex letter case. It sounds like a policies for real or Boolean formatters but I didn’t find one for hex. Is it possible to achieve the above without policy?
Padding can be achieved by using the right_align[] directive: http://www.boost.org/doc/libs/1_58_0/libs/spirit/doc/html/spirit/karma/refer.... You can control the hex-letter case using the upper[] and lower[] directives: http://www.boost.org/doc/libs/1_58_0/libs/spirit/doc/html/spirit/karma/refer.... HTH Regards Hartmut --------------- http://boost-spirit.com http://stellar.cct.lsu.edu _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users