MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / write_int

Method write_int

extlibs/fmt/include/fmt/format.h:1449–1466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1447 // where <digits> are written by f(it).
1448 template <typename F>
1449 void write_int(int num_digits, string_view prefix, format_specs specs, F f) {
1450 std::size_t size = prefix.size() + to_unsigned(num_digits);
1451 char_type fill = specs.fill[0];
1452 std::size_t padding = 0;
1453 if (specs.align == align::numeric) {
1454 auto unsiged_width = to_unsigned(specs.width);
1455 if (unsiged_width > size) {
1456 padding = unsiged_width - size;
1457 size = unsiged_width;
1458 }
1459 } else if (specs.precision > num_digits) {
1460 size = prefix.size() + to_unsigned(specs.precision);
1461 padding = to_unsigned(specs.precision - num_digits);
1462 fill = static_cast<char_type>('0');
1463 }
1464 if (specs.align == align::none) specs.align = align::right;
1465 write_padded(specs, padded_int_writer<F>{size, prefix, fill, padding, f});
1466 }
1467
1468 // Writes a decimal integer.
1469 template <typename Int> void write_decimal(Int value) {

Callers 7

on_decMethod · 0.80
on_hexMethod · 0.80
on_binMethod · 0.80
on_octMethod · 0.80
on_numMethod · 0.80
operator()Method · 0.80
on_intMethod · 0.80

Calls 2

handle_int_type_specFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected