Yet another C++ text formatting library.
Bug fix: Flush buffer on the destructor of basic_string_appender()
Breaking changes
Changed how printable types are to be added
Redesigned transcoding API
removed surrogate_policy
facet
width_decumulator
is now default constructed with remaining_width() == width_max
remove copy-constructor from array_destination
printing of integers is not overridable anymore
added template parameter to printable_overrider_c
Renamed/replaced
In PrintingTraits: formatters
-> format_specifiers
_formatter
to _format_specifiers
in all namesNamed type requirements Formatters to FormatSpecifier
conv
-> transcode
value_with_formatters -> value_and_format
codepoints_robust_count
-> count_codepoints
codepoints_robust_count_f
-> count_codepoints_f
codepoints_fast_count
-> count_codepoints_fast
codepoints_fast_count_f
-> codepoints_fast_count_f
codepoints_count_result
-> count_codepoints_result<CharT>
width_and_pos
-> width_and_ptr<CharT>
min_space_after_recycle
to min_destination_buffer_size
basic_cstr_writer
to basic_cstr_destination
basic_char_array_writer
to array_destination
discarded_destination
to discarder
type requirement PrintTraits
-> PrintableDef
formatters
-> format_specifiers
make_printer_input
-> PrintTraits::make_input
removed type requirement PrinterInput
struct template print_traits
-> printer
, and
print_traits_of
-> printer_of
print_traits_tag
-> printable_tag
function template preview
to precalculate
class templates
print_preview
to premeasurements
size_preview
to size_accumulator
width_preview
to width_accumulator
( and redesigned )type alias print_size_and_width_preview
to full_premeasurements
enumerations
preview_size
to precalc_size
preview_width
to precalc_width
Replace class templates destination_no_reserve
,
destination_calc_size
and destination_with_given_size
by printing_syntax
Change Transcode requirements
transcode
unsafe_transcode
and unsafe_transcode_size
src_char_type
-> src_code_unit
dst_char_type
-> dst_code_unit
Redesigned destination
:
destination<CharT>
now is a type alias to output_buffer<CharT, 64>
, where output_buffer<CharT, N>
derives from output_buffer<CharT, N - 1>
and the poscondition of output_buffer<CharT, N>::recycle_buffer()
is that space() >= (1 >> N)
char_type
to value_type
size
Removed deprecated type aliases: basic_outbuff
, bin_outbuff
, u8outbuff
, u16outbuff
, u32outbuff
, woutbuff
Removed deprecated class template width_by_func
( and function template make_width_calculator
)
Replaced facet invalid_seq_notifer
by transcoding_error_notifer
When transcoding U+FFFD, just translate it to the replacement character of the destination encoding ( don't call trascoding_error_notifier::unsupported_codepoint anymore )
Replacing unsigned integers with signed everywhere. Including:
Fixed bugs:
strf::fixed(0.051).p(1)
Rename class template basic_outbuff
to destination
And its member functions:
pointer()
-> buffer_ptr()
end()
-> buffer_end()
space()
-> buffer_space()
But create aliases with the old names to preserve backward compatibility
Fix bugs in floating-point printing:
strf::fixed(1e-30, 3)
)strf::gen(120.1, 3) > 10
Fix some mistakes in CMakeLists.txt:
strf-cuda
was equivalent to strf-header-only
std::format
narrow_cfile_writer
, wide_cfile_write
and basic_streambuf_writer
call recycle
( or do something equivalent to that )Breaking changes:
punct
format function if you want to apply numeric punctuationwidth_t
unsignedwidth_t::round()
: now it rounds towards zero on ties ( instead of towards even number ).basic_outbuff_noexcept
.strf::get_facet
to strf::use_facet
outbuff_garbage_buf
to garbage_buff
char_encoding
to charset
andchar_encoding_id
to charset_eid
eid_*
to scid_*
static_char_encoding
to static_charset
dynamic_char_encoding_data
to dynamic_charset_data
dynamic_char_encoding
to dynamic_charset
char_encoding_c
to charset_c
convert_encoding
to convert_charset`convert_from_encoding
to convert_from_charset`sanitize_encoding to sanitize_charset
sanitize_from_encoding to sanitize_from_charset
get_encoding
to get_charset
utf<CharT>
, utf8<CharT>
, strf::iso_8859_6<CharT>
, etc were renamed to utf_t<CharT>
, utf8_t<CharT>
, strf::iso_8859_6_t<CharT>
, etc. The old names ( utf<CharT>
, utf8<CharT>
, etc ) are now constexpr values.fast_width
, width_as_fast_u32len
, and width_as_u32len
were renamed to fast_width_t
, width_as_fast_u32len_t
and width_as_u32len_t
respectively. The old names are now constexpr values.width_calculator_c
to width_as_u32len_t
.tag<CharT>
parameter.Improvements:
char_array_writer
and to_range
( that writes to char*
without appending '\0' )Bug fixes:
Others things:
write
and and do_write
member functions in basic_outbuffBreaking changes:
text_alignment::split
operator%
join_split
alignment_formatter
-> dynamic_alignment_formatter
empty_alignment_formatter
-> alignment_formatter
float_formatter
. Now there is instead a float_notation
member variable in float_format
.New features
pad0
( similar to printf
format flat '0'
)fill_sign
( can also use operator~
). ( similar to printf
format flat ' '
)Little improvements:
PrintTraits::make_printer_input<CharT>(p,facets,x)
is ill-formed, then PrintTraits::make_printer_input<CharT>(p,facets,fmt(x))
is used instead. This reduces boilter-plate code when you extend the library ( add a new printable type )Bugfix: Header <intrin.h>
was being included inside namespace strf::detail::ryu
New features
strf::preview
function template.Breaking changes:
basic_outbuff
, renamed size
to space
size_preview
, renamed get_size
to accumulated_size
.width_preview
, changed behaviour of subtract_width
and removed checked_subtract_width
.usual_printer_input
, rename fp
to facets
.digits_group_iterator
fill
must be of a character type*oct(0)
is printed as "0", not "00"operator~
( replaced by operator*
)Enhance documenation:
numpunct
facet in strf_hpp.html