Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
format.h File Reference
#include <cmath>
#include <cstdint>
#include <cstring>
#include <initializer_list>
#include <limits>
#include <memory>
#include <stdexcept>
#include <system_error>
#include "core.h"
Include dependency graph for format.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  detail::arg_formatter< Char >
 
struct  detail::basic_fp< F >
 
class  basic_memory_buffer< T, SIZE, Allocator >
 
struct  detail::big_decimal_fp
 
class  detail::bigint
 
class  bytes
 
class  detail::counting_iterator
 
struct  detail::dragonbox::decimal_fp< T >
 
struct  detail::default_arg_formatter< Char >
 
class  detail::digit_grouping< Char >
 
class  detail::fallback_digit_grouping< Char >
 
struct  detail::find_escape_result< Char >
 
struct  detail::dragonbox::float_info< T, Enable >
 
struct  detail::dragonbox::float_info< double >
 
struct  detail::dragonbox::float_info< float >
 
struct  detail::dragonbox::float_info< T, enable_if_t< is_double_double< T >::value > >
 
struct  detail::dragonbox::float_info< T, enable_if_t< std::numeric_limits< T >::digits==64||std::numeric_limits< T >::digits==113||is_float128< T >::value > >
 
struct  detail::float_specs
 
struct  detail::format_decimal_result< Iterator >
 
class  format_facet< Locale >
 
class  format_int
 
struct  formatter< bytes >
 
struct  formatter< Char[N], Char >
 
struct  formatter< group_digits_view< T > >
 
struct  formatter< join_view< It, Sentinel, Char >, Char >
 
struct  formatter< nested_view< T > >
 
struct  formatter< T, Char, enable_if_t< detail::has_format_as< T >::value > >
 
struct  group_digits_view< T >
 
struct  detail::has_isfinite< T, Enable >
 
struct  detail::has_isfinite< T, enable_if_t< sizeof(std::isfinite(T())) !=0 > >
 
struct  is_contiguous< basic_memory_buffer< T, SIZE, Allocator > >
 
struct  detail::is_integral< T >
 
struct  detail::is_integral< int128_opt >
 
struct  detail::is_integral< uint128_t >
 
struct  join_view< It, Sentinel, Char >
 
class  loc_value
 
struct  detail::loc_writer< Char >
 
struct  nested_formatter< T >
 
struct  nested_view< T >
 
struct  detail::digit_grouping< Char >::next_state
 
struct  detail::precision_checker
 
struct  detail::string_literal< CharT, C >
 
struct  detail::thousands_sep_result< Char >
 
class  detail::to_utf8< WChar, Buffer >
 
class  detail::uint128_fallback
 
class  detail::utf8_to_utf16
 
struct  detail::counting_iterator::value_type
 
struct  detail::width_checker
 
struct  detail::write_int_arg< UInt >
 
struct  detail::write_int_data< Char >
 

Namespaces

 detail
 
 detail::dragonbox
 
 detail_exported
 
 enums
 

Macros

#define FMT_CATCH(x)   catch (x)
 
#define FMT_DEPRECATED   /* deprecated */
 
#define FMT_FALLTHROUGH
 
#define FMT_FORMAT_AS(Type, Base)
 
#define FMT_FUNC
 
#define FMT_HAS_BUILTIN(x)   0
 
#define FMT_INLINE_VARIABLE
 
#define FMT_MAYBE_UNUSED
 
#define FMT_NO_UNIQUE_ADDRESS
 
#define FMT_NOINLINE
 
#define FMT_POWERS_OF_10(factor)
 
#define FMT_REDUCE_INT_INSTANTIATIONS   0
 
#define FMT_SO_VISIBILITY(value)
 
#define FMT_STRING(s)   FMT_STRING_IMPL(s, fmt::detail::compile_string, )
 
#define FMT_STRING_IMPL(s, base, explicit)
 
#define FMT_THROW(x)   throw x
 
#define FMT_TRY   try
 
#define FMT_USE_DOUBLE   1
 
#define FMT_USE_FLOAT   1
 
#define FMT_USE_FLOAT128   0
 
#define FMT_USE_FULL_CACHE_DRAGONBOX   0
 
#define FMT_USE_LONG_DOUBLE   1
 
#define FMT_USE_USER_DEFINED_LITERALS   0
 

Typedefs

template<typename T , bool doublish = num_bits<T>() == num_bits<double>()>
using detail::convert_float_result = conditional_t< std::is_same< T, float >::value||doublish, double, T >
 
using detail::float128 = void
 
using detail::format_func = void(*)(detail::buffer< char > &, int, const char *)
 
using detail::fp = basic_fp< unsigned long long >
 
template<typename T >
using detail::is_float128 = std::is_same< T, float128 >
 
template<typename T >
using detail::is_floating_point = bool_constant< std::is_floating_point< T >::value||is_float128< T >::value >
 
template<typename T >
using detail::is_integer = bool_constant< is_integral< T >::value &&!std::is_same< T, bool >::value &&!std::is_same< T, char >::value &&!std::is_same< T, wchar_t >::value >
 
template<typename T >
using detail::is_signed = std::integral_constant< bool, std::numeric_limits< T >::is_signed||std::is_same< T, int128_opt >::value >
 
template<typename T >
using detail::iterator_t = decltype(std::begin(std::declval< T & >()))
 
template<typename Char >
using detail::make_unsigned_char = typename conditional_t< std::is_integral< Char >::value, std::make_unsigned< Char >, type_identity< uint32_t > >::type
 
using memory_buffer = basic_memory_buffer< char >
 
template<typename OutputIt >
using detail::reserve_iterator = remove_reference_t< decltype(reserve(std::declval< OutputIt & >(), 0))>
 
template<typename T >
using detail::sentinel_t = decltype(std::end(std::declval< T & >()))
 
using detail::uint128_t = conditional_t< FMT_USE_INT128, uint128_opt, uint128_fallback >
 
template<typename T >
using detail::uint32_or_64_or_128_t = conditional_t< num_bits< T >()<=32 &&!FMT_REDUCE_INT_INSTANTIATIONS, uint32_t, conditional_t< num_bits< T >()<=64, uint64_t, uint128_t > >
 
template<typename T >
using detail::uint64_or_128_t = conditional_t< num_bits< T >()<=64, uint64_t, uint128_t >
 
using detail::uintptr_t = uint128_t
 

Enumerations

enum  { inline_buffer_size = 500 }
 
enum  detail::char8_type : unsigned char
 
enum  detail::dragon { detail::predecessor_closer = 1, detail::fixup = 2, detail::fixed = 4, detail::fixed }
 
enum  detail::float_format : unsigned char { detail::float_format::general, detail::float_format::exp, detail::fixed, detail::float_format::hex }
 
enum  detail::to_utf8_error_policy { detail::to_utf8_error_policy::abort, detail::to_utf8_error_policy::replace }
 

Functions

FMT_CONSTEXPR void detail::abort_fuzzing_if (bool condition)
 
FMT_CONSTEXPR20 void detail::adjust_precision (int &precision, int exp10)
 
FMT_INLINE void detail::assume (bool condition)
 
template<typename Iterator >
constexpr auto detail::base_iterator (Iterator, Iterator it) -> Iterator
 
template<typename Container , FMT_ENABLE_IF(is_contiguous< Container >::value) >
auto detail::base_iterator (std::back_insert_iterator< Container > it, typename Container::value_type *) -> std::back_insert_iterator< Container >
 
template<typename To , typename From , FMT_ENABLE_IF(sizeof(To)==sizeof(From)) >
FMT_CONSTEXPR20 auto detail::bit_cast (const From &from) -> To
 
template<typename To , typename From , FMT_ENABLE_IF(sizeof(To) > sizeof(From)) >
auto detail::bit_cast (const From &from) -> To
 
template<typename Char >
auto detail::code_point_index (basic_string_view< Char > s, size_t n) -> size_t
 
auto detail::code_point_index (basic_string_view< char8_type > s, size_t n) -> size_t
 
auto detail::code_point_index (string_view s, size_t n) -> size_t
 
template<typename Char , size_t N>
constexpr auto detail_exported::compile_string_to_view (const Char(&s)[N]) -> basic_string_view< Char >
 
template<typename Char >
constexpr auto detail_exported::compile_string_to_view (detail::std_string_view< Char > s) -> basic_string_view< Char >
 
template<typename Char >
auto detail::compute_width (basic_string_view< Char > s) -> size_t
 
auto detail::compute_width (basic_string_view< char8_type > s) -> size_t
 
FMT_CONSTEXPR auto detail::compute_width (string_view s) -> size_t
 
template<typename T >
constexpr auto detail::convert_float (T value) -> convert_float_result< T >
 
template<typename Char >
FMT_CONSTEXPR20 FMT_INLINE void detail::copy2 (Char *dst, const char *src)
 
template<typename OutChar , typename InputIt , typename OutputIt >
FMT_CONSTEXPR FMT_NOINLINE auto detail::copy_str_noinline (InputIt begin, InputIt end, OutputIt out) -> OutputIt
 
template<int BITS, typename UInt >
FMT_CONSTEXPR auto detail::count_digits (UInt n) -> int
 
FMT_CONSTEXPR20 auto detail::count_digits (uint32_t n) -> int
 
FMT_CONSTEXPR20 auto detail::count_digits (uint64_t n) -> int
 
template<typename T >
FMT_CONSTEXPR auto detail::count_digits_fallback (T n) -> int
 
FMT_CONSTEXPR20 auto detail::countl_zero (uint32_t n) -> int
 
FMT_CONSTEXPR20 auto detail::countl_zero (uint64_t n) -> int
 
template<typename UInt >
FMT_CONSTEXPR20 auto detail::countl_zero_fallback (UInt n) -> int
 
template<typename Char >
auto detail::decimal_point (locale_ref loc) -> Char
 
template<>
auto detail::decimal_point (locale_ref loc) -> wchar_t
 
template<typename Char >
FMT_FUNC auto detail::decimal_point_impl (locale_ref loc) -> Char
 
template<typename Char >
FMT_API auto detail::decimal_point_impl (locale_ref loc) -> Char
 
template<typename Int >
constexpr auto detail::digits10 () noexcept -> int
 
template<>
constexpr auto detail::digits10< int128_opt > () noexcept -> int
 
template<>
constexpr auto detail::digits10< uint128_t > () noexcept -> int
 
constexpr auto detail::digits2 (size_t value) -> const char *
 
template<typename OutputIt , typename DecimalFP , typename Char , typename Grouping = digit_grouping<Char>>
FMT_CONSTEXPR20 auto detail::do_write_float (OutputIt out, const DecimalFP &f, const format_specs< Char > &specs, float_specs fspecs, locale_ref loc) -> OutputIt
 
template<typename Char >
auto detail::equal2 (const Char *lhs, const char *rhs) -> bool
 
auto detail::equal2 (const char *lhs, const char *rhs) -> bool
 
template<typename Float >
constexpr auto detail::exponent_bias () -> int
 
template<typename Float >
constexpr auto detail::exponent_mask () -> typename dragonbox::float_info< Float >::carrier_uint
 
template<typename OutputIt , typename Char >
FMT_NOINLINE FMT_CONSTEXPR auto detail::fill (OutputIt it, size_t n, const fill_t< Char > &fill) -> OutputIt
 
template<typename OutputIt , typename Size , typename T >
FMT_CONSTEXPR auto detail::fill_n (OutputIt out, Size count, const T &value) -> OutputIt
 
template<typename T , typename Size >
FMT_CONSTEXPR20 auto detail::fill_n (T *out, Size count, char value) -> T *
 
template<typename Char >
auto detail::find_escape (const Char *begin, const Char *end) -> find_escape_result< Char >
 
auto detail::find_escape (const char *begin, const char *end) -> find_escape_result< char >
 
auto detail::dragonbox::floor_log10_pow2 (int e) noexcept -> int
 
auto detail::dragonbox::floor_log2_pow10 (int e) noexcept -> int
 
 FMT_FORMAT_AS (Char *, const Char *)
 
 FMT_FORMAT_AS (detail::std_string_view< Char >, basic_string_view< Char >)
 
 FMT_FORMAT_AS (long, detail::long_type)
 
 FMT_FORMAT_AS (short, int)
 
 FMT_FORMAT_AS (signed char, int)
 
 FMT_FORMAT_AS (std::basic_string< Char >, basic_string_view< Char >)
 
 FMT_FORMAT_AS (std::nullptr_t, const void *)
 
 FMT_FORMAT_AS (unsigned char, unsigned)
 
 FMT_FORMAT_AS (unsigned long, detail::ulong_type)
 
 FMT_FORMAT_AS (unsigned short, unsigned)
 
 FMT_FORMAT_AS (void *, const void *)
 
template<typename F >
FMT_CONSTEXPR void detail::for_each_codepoint (string_view s, F f)
 
template<typename Locale , typename... T, FMT_ENABLE_IF(detail::is_locale< Locale >::value) >
auto format (const Locale &loc, format_string< T... > fmt, T &&... args) -> std::string
 
template<typename Enum , FMT_ENABLE_IF(std::is_enum< Enum >::value) >
constexpr auto enums::format_as (Enum e) noexcept -> underlying_t< Enum >
 
template<typename Char , typename UInt >
FMT_CONSTEXPR20 auto detail::format_decimal (Char *out, UInt value, int size) -> format_decimal_result< Char * >
 
template<typename Char , typename UInt , typename Iterator , FMT_ENABLE_IF(!std::is_pointer< remove_cvref_t< Iterator >>::value) >
FMT_CONSTEXPR auto detail::format_decimal (Iterator out, UInt value, int size) -> format_decimal_result< Iterator >
 
FMT_CONSTEXPR20 void detail::format_dragon (basic_fp< uint128_t > value, unsigned flags, int num_digits, buffer< char > &buf, int &exp10)
 
FMT_FUNC void detail::format_error_code (detail::buffer< char > &out, int error_code, string_view message) noexcept
 
template<typename Float >
FMT_CONSTEXPR20 auto detail::format_float (Float value, int precision, float_specs specs, buffer< char > &buf) -> int
 
template<typename Float , FMT_ENABLE_IF(!is_double_double< Float >::value) >
FMT_CONSTEXPR20 void detail::format_hexfloat (Float value, int precision, float_specs specs, buffer< char > &buf)
 
FMT_API void format_system_error (detail::buffer< char > &out, int error_code, const char *message) noexcept
 
template<typename OutputIt , typename Locale , typename... T, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value && detail::is_locale< Locale >::value) >
FMT_INLINE auto format_to (OutputIt out, const Locale &loc, format_string< T... > fmt, T &&... args) -> OutputIt
 
template<unsigned BASE_BITS, typename Char , typename UInt >
FMT_CONSTEXPR auto detail::format_uint (Char *buffer, UInt value, int num_digits, bool upper=false) -> Char *
 
template<unsigned BASE_BITS, typename Char , typename It , typename UInt >
FMT_CONSTEXPR auto detail::format_uint (It out, UInt value, int num_digits, bool upper=false) -> It
 
template<typename Locale , typename... T, FMT_ENABLE_IF(detail::is_locale< Locale >::value) >
FMT_NODISCARD FMT_INLINE auto formatted_size (const Locale &loc, format_string< T... > fmt, T &&... args) -> size_t
 
constexpr auto detail::fractional_part_rounding_thresholds (int index) -> uint32_t
 
template<typename Context , typename ID >
FMT_CONSTEXPR auto detail::get_arg (Context &ctx, ID id) -> decltype(ctx.arg(id))
 
FMT_FUNC auto detail::dragonbox::get_cached_power (int k) noexcept -> uint128_fallback
 
template<typename Container >
auto detail::get_data (Container &c) -> typename Container::value_type *
 
template<typename Char >
auto detail::get_data (std::basic_string< Char > &s) -> Char *
 
template<typename Handler , typename FormatArg >
FMT_CONSTEXPR auto detail::get_dynamic_spec (FormatArg arg) -> int
 
constexpr auto detail::get_significand_size (const big_decimal_fp &f) -> int
 
template<typename T >
auto detail::get_significand_size (const dragonbox::decimal_fp< T > &f) -> int
 
template<typename T >
auto group_digits (T value) -> group_digits_view< T >
 
template<typename Handler , typename Context >
FMT_CONSTEXPR void detail::handle_dynamic_spec (int &value, arg_ref< typename Context::char_type > ref, Context &ctx)
 
template<typename Float >
constexpr auto detail::has_implicit_bit () -> bool
 
auto detail::is_big_endian () -> bool
 
template<typename T , FMT_ENABLE_IF(is_signed< T >::value) >
constexpr auto detail::is_negative (T value) -> bool
 
FMT_FUNC auto detail::is_printable (uint32_t cp) -> bool
 
template<typename T >
FMT_CONSTEXPR auto detail::is_supported_floating_point (T) -> bool
 
template<typename T , FMT_ENABLE_IF(std::is_floating_point< T >::value && has_isfinite< T >::value) >
FMT_CONSTEXPR20 auto detail::isfinite (T value) -> bool
 
template<typename T , FMT_ENABLE_IF(!has_isfinite< T >::value) >
FMT_CONSTEXPR auto detail::isfinite (T value) -> bool
 
template<typename T >
constexpr auto detail::isnan (T value) -> bool
 
template<typename It , typename Sentinel >
auto join (It begin, Sentinel end, string_view sep) -> join_view< It, Sentinel >
 
template<typename Range >
auto join (Range &&range, string_view sep) -> join_view< detail::iterator_t< Range >, detail::sentinel_t< Range >>
 
template<typename T >
FMT_CONSTEXPR auto detail::make_write_int_arg (T value, sign_t sign) -> write_int_arg< uint32_or_64_or_128_t< T >>
 
template<typename T >
constexpr auto detail::max_value () -> T
 
FMT_CONSTEXPR auto detail::multiply (uint64_t lhs, uint64_t rhs) -> uint64_t
 
auto detail::needs_escape (uint32_t cp) -> bool
 
template<int SHIFT = 0, typename F >
FMT_CONSTEXPR auto detail::normalize (basic_fp< F > value) -> basic_fp< F >
 
template<typename T >
constexpr auto detail::num_bits () -> int
 
template<>
constexpr auto detail::num_bits< int128_opt > () -> int
 
template<>
constexpr auto detail::num_bits< uint128_t > () -> int
 
template<typename Float >
constexpr auto detail::num_significand_bits () -> int
 
FMT_CONSTEXPR auto detail::operator* (fp x, fp y) -> fp
 
template<typename Char >
FMT_CONSTEXPR auto detail::parse_align (const Char *begin, const Char *end, format_specs< Char > &specs) -> const Char *
 
template<typename Char >
FMT_CONSTEXPR auto detail::parse_float_type_spec (const format_specs< Char > &specs) -> float_specs
 
FMT_CONSTEXPR void detail::prefix_append (unsigned &prefix, unsigned value)
 
FMT_FUNC void detail::print (std::FILE *f, string_view text)
 
template<typename T >
auto ptr (const std::shared_ptr< T > &p) -> const void *
 
template<typename T , typename Deleter >
auto ptr (const std::unique_ptr< T, Deleter > &p) -> const void *
 
template<typename T >
auto ptr (T p) -> const void *
 
FMT_FUNC void detail::report_error (format_func func, int error_code, const char *message) noexcept
 
FMT_API void report_system_error (int error_code, const char *message) noexcept
 
template<typename T >
auto detail::reserve (buffer_appender< T > it, size_t n) -> buffer_appender< T >
 
template<typename Iterator >
constexpr auto detail::reserve (Iterator &it, size_t) -> Iterator &
 
template<typename Container , FMT_ENABLE_IF(is_contiguous< Container >::value) >
auto detail::reserve (std::back_insert_iterator< Container > it, size_t n) -> typename Container::value_type *
 
template<typename Char , typename Sign >
constexpr auto detail::sign (Sign s) -> Char
 
template<typename T , FMT_ENABLE_IF(is_floating_point< T >::value) >
FMT_INLINE FMT_CONSTEXPR bool detail::signbit (T value)
 
template<typename... T>
auto system_error (int error_code, format_string< T... > fmt, T &&... args) -> std::system_error
 
template<typename Char >
auto detail::thousands_sep (locale_ref loc) -> thousands_sep_result< Char >
 
template<>
auto detail::thousands_sep (locale_ref loc) -> thousands_sep_result< wchar_t >
 
template<typename Char >
FMT_API auto detail::thousands_sep_impl (locale_ref loc) -> thousands_sep_result< Char >
 
template FMT_API auto detail::thousands_sep_impl< char > (locale_ref) -> thousands_sep_result< char >
 
template FMT_API auto detail::thousands_sep_impl< wchar_t > (locale_ref) -> thousands_sep_result< wchar_t >
 
template<typename T >
FMT_API auto detail::dragonbox::to_decimal (T x) noexcept -> decimal_fp< T >
 
template<typename T >
auto detail::to_pointer (buffer_appender< T > it, size_t n) -> T *
 
template<typename T , typename OutputIt >
constexpr auto detail::to_pointer (OutputIt, size_t) -> T *
 
template<typename Char , size_t SIZE>
FMT_NODISCARD auto to_string (const basic_memory_buffer< Char, SIZE > &buf) -> std::basic_string< Char >
 
template<typename T , FMT_ENABLE_IF(!std::is_integral< T >::value && !detail::has_format_as< T >::value) >
auto to_string (const T &value) -> std::string
 
template<typename T , FMT_ENABLE_IF(std::is_integral< T >::value) >
FMT_NODISCARD auto to_string (T value) -> std::string
 
auto detail::umul128 (uint64_t x, uint64_t y) noexcept -> uint128_fallback
 
auto detail::dragonbox::umul128_upper64 (uint64_t x, uint64_t y) noexcept -> uint64_t
 
auto detail::dragonbox::umul192_upper128 (uint64_t x, uint128_fallback y) noexcept -> uint128_fallback
 
template<typename Enum >
constexpr auto underlying (Enum e) noexcept -> underlying_t< Enum >
 
FMT_CONSTEXPR auto detail::utf8_decode (const char *s, uint32_t *c, int *e) -> const char *
 
template<typename Locale , typename Char >
auto detail::vformat (const Locale &loc, basic_string_view< Char > fmt, basic_format_args< buffer_context< type_identity_t< Char >>> args) -> std::basic_string< Char >
 
template<typename Locale , FMT_ENABLE_IF(detail::is_locale< Locale >::value) >
auto vformat (const Locale &loc, string_view fmt, format_args args) -> std::string
 
FMT_BEGIN_EXPORT template FMT_API void detail::vformat_to (buffer< char > &, string_view, typename vformat_args<>::type, locale_ref)
 
template<typename Char >
void detail::vformat_to (buffer< Char > &buf, basic_string_view< Char > fmt, typename vformat_args< Char >::type args, locale_ref loc={})
 
template<typename OutputIt , typename Locale , FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value && detail::is_locale< Locale >::value) >
auto vformat_to (OutputIt out, const Locale &loc, string_view fmt, format_args args) -> OutputIt
 
FMT_API auto vsystem_error (int error_code, string_view format_str, format_args args) -> std::system_error
 
template<typename Char , typename OutputIt >
FMT_CONSTEXPR auto detail::write (OutputIt out, basic_string_view< Char > s, const format_specs< Char > &specs) -> OutputIt
 
template<typename Char , typename OutputIt >
FMT_CONSTEXPR auto detail::write (OutputIt out, basic_string_view< Char > value) -> OutputIt
 
template<typename Char , typename OutputIt >
FMT_CONSTEXPR auto detail::write (OutputIt out, basic_string_view< type_identity_t< Char >> s, const format_specs< Char > &specs, locale_ref) -> OutputIt
 
template<typename Char , typename OutputIt >
FMT_CONSTEXPR auto detail::write (OutputIt out, Char value) -> OutputIt
 
template<typename Char , typename OutputIt >
FMT_CONSTEXPR auto detail::write (OutputIt out, Char value, const format_specs< Char > &specs, locale_ref loc={}) -> OutputIt
 
template<typename Char , typename OutputIt >
FMT_CONSTEXPR auto detail::write (OutputIt out, const Char *s, const format_specs< Char > &specs, locale_ref) -> OutputIt
 
template<typename Char , typename OutputIt >
FMT_CONSTEXPR_CHAR_TRAITS auto detail::write (OutputIt out, const Char *value) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , typename Context = basic_format_context<OutputIt, Char>>
FMT_CONSTEXPR auto detail::write (OutputIt out, const T &value) -> enable_if_t< std::is_class< T >::value &&!is_string< T >::value &&!is_floating_point< T >::value &&!std::is_same< T, Char >::value &&!std::is_same< T, remove_cvref_t< decltype(arg_mapper< Context >().map(value))>>::value, OutputIt >
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(is_string< T >::value) >
constexpr auto detail::write (OutputIt out, const T &value) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(std::is_same< T, void >::value) >
auto detail::write (OutputIt out, const T *value, const format_specs< Char > &specs={}, locale_ref={}) -> OutputIt
 
template<typename Char , typename OutputIt >
auto detail::write (OutputIt out, monostate, format_specs< Char >={}, locale_ref={}) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(is_integral< T >::value && !std::is_same< T, bool >::value && !std::is_same< T, Char >::value) >
FMT_CONSTEXPR auto detail::write (OutputIt out, T value) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(is_fast_float< T >::value) >
FMT_CONSTEXPR20 auto detail::write (OutputIt out, T value) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(is_floating_point< T >::value && !is_fast_float< T >::value) >
auto detail::write (OutputIt out, T value) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , bool check = std::is_enum<T>::value && !std::is_same<T, Char>::value && mapped_type_constant<T, basic_format_context<OutputIt, Char>>::value != type::custom_type, FMT_ENABLE_IF(check) >
FMT_CONSTEXPR auto detail::write (OutputIt out, T value) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(is_integral< T >::value && !std::is_same< T, bool >::value && std::is_same< OutputIt, buffer_appender< Char >>::value) >
FMT_CONSTEXPR FMT_INLINE auto detail::write (OutputIt out, T value, const format_specs< Char > &specs, locale_ref loc) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(std::is_same< T, bool >::value) >
FMT_CONSTEXPR auto detail::write (OutputIt out, T value, const format_specs< Char > &specs={}, locale_ref={}) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(is_floating_point< T >::value) >
FMT_CONSTEXPR20 auto detail::write (OutputIt out, T value, format_specs< Char > specs, locale_ref loc={}) -> OutputIt
 
template<align::type align = align::left, typename Char , typename OutputIt >
FMT_CONSTEXPR auto detail::write_bytes (OutputIt out, string_view bytes, const format_specs< Char > &specs) -> OutputIt
 
template<typename Char , typename OutputIt >
FMT_CONSTEXPR auto detail::write_char (OutputIt out, Char value, const format_specs< Char > &specs) -> OutputIt
 
template<size_t width, typename Char , typename OutputIt >
auto detail::write_codepoint (OutputIt out, char prefix, uint32_t cp) -> OutputIt
 
FMT_FUNC auto detail::write_console (int, string_view) -> bool
 
FMT_FUNC auto detail::write_console (std::FILE *, string_view) -> bool
 
template<typename Char , typename OutputIt >
auto detail::write_escaped_char (OutputIt out, Char v) -> OutputIt
 
template<typename OutputIt , typename Char >
auto detail::write_escaped_cp (OutputIt out, const find_escape_result< Char > &escape) -> OutputIt
 
template<typename Char , typename OutputIt >
auto detail::write_escaped_string (OutputIt out, basic_string_view< Char > str) -> OutputIt
 
template<typename Char , typename It >
FMT_CONSTEXPR auto detail::write_exponent (int exp, It it) -> It
 
template<typename OutputIt , typename DecimalFP , typename Char >
FMT_CONSTEXPR20 auto detail::write_float (OutputIt out, const DecimalFP &f, const format_specs< Char > &specs, float_specs fspecs, locale_ref loc) -> OutputIt
 
template<typename Char , typename OutputIt , typename T >
FMT_CONSTEXPR20 auto detail::write_float (OutputIt out, T value, format_specs< Char > specs, locale_ref loc) -> OutputIt
 
template<typename OutputIt , typename Char , typename W >
FMT_CONSTEXPR FMT_INLINE auto detail::write_int (OutputIt out, int num_digits, unsigned prefix, const format_specs< Char > &specs, W write_digits) -> OutputIt
 
template<typename OutputIt , typename UInt , typename Char >
auto detail::write_int (OutputIt out, UInt value, unsigned prefix, const format_specs< Char > &specs, const digit_grouping< Char > &grouping) -> OutputIt
 
template<typename Char , typename OutputIt , typename T >
FMT_CONSTEXPR FMT_INLINE auto detail::write_int (OutputIt out, write_int_arg< T > arg, const format_specs< Char > &specs, locale_ref) -> OutputIt
 
template<typename Char , typename OutputIt , typename T >
FMT_CONSTEXPR FMT_NOINLINE auto detail::write_int_noinline (OutputIt out, write_int_arg< T > arg, const format_specs< Char > &specs, locale_ref loc) -> OutputIt
 
FMT_FUNC auto detail::write_loc (appender out, loc_value value, const format_specs<> &specs, locale_ref loc) -> bool
 
template<typename OutputIt , typename Char >
auto detail::write_loc (OutputIt, loc_value, const format_specs< Char > &, locale_ref) -> bool
 
template<typename Char , typename OutputIt >
FMT_CONSTEXPR20 auto detail::write_nonfinite (OutputIt out, bool isnan, format_specs< Char > specs, const float_specs &fspecs) -> OutputIt
 
template<align::type align = align::left, typename OutputIt , typename Char , typename F >
constexpr auto detail::write_padded (OutputIt out, const format_specs< Char > &specs, size_t size, F &&f) -> OutputIt
 
template<align::type align = align::left, typename OutputIt , typename Char , typename F >
FMT_CONSTEXPR auto detail::write_padded (OutputIt out, const format_specs< Char > &specs, size_t size, size_t width, F &&f) -> OutputIt
 
template<typename Char , typename OutputIt , typename UIntPtr >
auto detail::write_ptr (OutputIt out, UIntPtr value, const format_specs< Char > *specs) -> OutputIt
 
template<typename Char , typename UInt , FMT_ENABLE_IF(std::is_integral< UInt >::value) >
auto detail::write_significand (Char *out, UInt significand, int significand_size, int integral_size, Char decimal_point) -> Char *
 
template<typename Char , typename OutputIt >
constexpr auto detail::write_significand (OutputIt out, const char *significand, int significand_size) -> OutputIt
 
template<typename OutputIt , typename Char >
FMT_CONSTEXPR auto detail::write_significand (OutputIt out, const char *significand, int significand_size, int integral_size, Char decimal_point) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , typename Grouping >
FMT_CONSTEXPR20 auto detail::write_significand (OutputIt out, T significand, int significand_size, int exponent, const Grouping &grouping) -> OutputIt
 
template<typename OutputIt , typename Char , typename T , typename Grouping >
FMT_CONSTEXPR20 auto detail::write_significand (OutputIt out, T significand, int significand_size, int integral_size, Char decimal_point, const Grouping &grouping) -> OutputIt
 
template<typename Char , typename OutputIt , typename UInt >
auto detail::write_significand (OutputIt out, UInt significand, int significand_size) -> OutputIt
 
template<typename OutputIt , typename UInt , typename Char , FMT_ENABLE_IF(!std::is_pointer< remove_cvref_t< OutputIt >>::value) >
auto detail::write_significand (OutputIt out, UInt significand, int significand_size, int integral_size, Char decimal_point) -> OutputIt
 

Variables

constexpr FMT_INLINE_VARIABLE uint32_t detail::invalid_code_point = ~uint32_t()
 

Macro Definition Documentation

◆ FMT_CATCH

#define FMT_CATCH (   x)    catch (x)

Definition at line 140 of file format.h.

◆ FMT_DEPRECATED

#define FMT_DEPRECATED   /* deprecated */

Definition at line 77 of file format.h.

◆ FMT_FALLTHROUGH

#define FMT_FALLTHROUGH

Definition at line 65 of file format.h.

◆ FMT_FORMAT_AS

#define FMT_FORMAT_AS (   Type,
  Base 
)
Value:
template <typename Char> \

Definition at line 4039 of file format.h.

◆ FMT_FUNC

#define FMT_FUNC

Definition at line 4532 of file format.h.

◆ FMT_HAS_BUILTIN

#define FMT_HAS_BUILTIN (   x)    0

Definition at line 106 of file format.h.

◆ FMT_INLINE_VARIABLE

#define FMT_INLINE_VARIABLE

Definition at line 54 of file format.h.

◆ FMT_MAYBE_UNUSED

#define FMT_MAYBE_UNUSED

Definition at line 150 of file format.h.

◆ FMT_NO_UNIQUE_ADDRESS

#define FMT_NO_UNIQUE_ADDRESS

Definition at line 93 of file format.h.

◆ FMT_NOINLINE

#define FMT_NOINLINE

Definition at line 112 of file format.h.

◆ FMT_POWERS_OF_10

#define FMT_POWERS_OF_10 (   factor)
Value:
factor * 10, (factor) * 100, (factor) * 1000, (factor) * 10000, \
(factor) * 100000, (factor) * 1000000, (factor) * 10000000, \
(factor) * 100000000, (factor) * 1000000000

Definition at line 1121 of file format.h.

◆ FMT_REDUCE_INT_INSTANTIATIONS

#define FMT_REDUCE_INT_INSTANTIATIONS   0

Definition at line 173 of file format.h.

◆ FMT_SO_VISIBILITY

#define FMT_SO_VISIBILITY (   value)

Definition at line 100 of file format.h.

◆ FMT_STRING

#define FMT_STRING (   s)    FMT_STRING_IMPL(s, fmt::detail::compile_string, )

\rst Constructs a compile-time format string from a string literal s.

Example**::

A compile-time error because 'd' is an invalid specifier for strings. std::string s = fmt::format(FMT_STRING("{:d}"), "foo"); \endrst

Definition at line 1848 of file format.h.

◆ FMT_STRING_IMPL

#define FMT_STRING_IMPL (   s,
  base,
  explicit 
)
Value:
[] { \
/* Use the hidden visibility as a workaround for a GCC bug (#1973). */ \
/* Use a macro-like name to avoid shadowing warnings. */ \
struct FMT_VISIBILITY("hidden") FMT_COMPILE_STRING : base { \
using char_type FMT_MAYBE_UNUSED = fmt::remove_cvref_t<decltype(s[0])>; \
FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit \
operator fmt::basic_string_view<char_type>() const { \
return fmt::detail_exported::compile_string_to_view<char_type>(s); \
} \
}; \
return FMT_COMPILE_STRING(); \
}()

Definition at line 1824 of file format.h.

◆ FMT_THROW

#define FMT_THROW (   x)    throw x

Definition at line 130 of file format.h.

◆ FMT_TRY

#define FMT_TRY   try

Definition at line 139 of file format.h.

◆ FMT_USE_DOUBLE

#define FMT_USE_DOUBLE   1

Definition at line 788 of file format.h.

◆ FMT_USE_FLOAT

#define FMT_USE_FLOAT   1

Definition at line 785 of file format.h.

◆ FMT_USE_FLOAT128

#define FMT_USE_FLOAT128   0

Definition at line 807 of file format.h.

◆ FMT_USE_FULL_CACHE_DRAGONBOX

#define FMT_USE_FULL_CACHE_DRAGONBOX   0

◆ FMT_USE_LONG_DOUBLE

#define FMT_USE_LONG_DOUBLE   1

Definition at line 791 of file format.h.

◆ FMT_USE_USER_DEFINED_LITERALS

#define FMT_USE_USER_DEFINED_LITERALS   0

Definition at line 164 of file format.h.

Typedef Documentation

◆ memory_buffer

Definition at line 993 of file format.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
inline_buffer_size 

Definition at line 858 of file format.h.

Function Documentation

◆ FMT_FORMAT_AS() [1/11]

FMT_FORMAT_AS ( Char *  ,
const Char *   
)

◆ FMT_FORMAT_AS() [2/11]

FMT_FORMAT_AS ( detail::std_string_view< Char >  ,
basic_string_view< Char >   
)

◆ FMT_FORMAT_AS() [3/11]

FMT_FORMAT_AS ( long  ,
detail::long_type   
)

◆ FMT_FORMAT_AS() [4/11]

FMT_FORMAT_AS ( short  ,
int   
)

◆ FMT_FORMAT_AS() [5/11]

FMT_FORMAT_AS ( signed char  ,
int   
)

◆ FMT_FORMAT_AS() [6/11]

FMT_FORMAT_AS ( std::basic_string< Char >  ,
basic_string_view< Char >   
)

◆ FMT_FORMAT_AS() [7/11]

FMT_FORMAT_AS ( std::nullptr_t  ,
const void *   
)

◆ FMT_FORMAT_AS() [8/11]

FMT_FORMAT_AS ( unsigned char  ,
unsigned   
)

◆ FMT_FORMAT_AS() [9/11]

FMT_FORMAT_AS ( unsigned long  ,
detail::ulong_type   
)

◆ FMT_FORMAT_AS() [10/11]

FMT_FORMAT_AS ( unsigned short  ,
unsigned   
)

◆ FMT_FORMAT_AS() [11/11]

FMT_FORMAT_AS ( void *  ,
const void *   
)

◆ format()

template<typename Locale , typename... T, FMT_ENABLE_IF(detail::is_locale< Locale >::value) >
auto format ( const Locale &  loc,
format_string< T... >  fmt,
T &&...  args 
) -> std::string
inline

Definition at line 4469 of file format.h.

◆ format_system_error()

FMT_API void format_system_error ( detail::buffer< char > &  out,
int  error_code,
const char *  message 
)
noexcept

\rst Formats an error message for an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out. The format is the same as the one used by std::system_error(ec, message) where ec is std::error_code(error_code, std::generic_category()}). It is implementation-defined but normally looks like:

.. parsed-literal:: <message>*: *<system-message>*

where *<message>* is the passed message and *<system-message>* is the system message corresponding to the error code. error_code* is a system error code as given by errno. \endrst

Definition at line 1410 of file format-inl.h.

◆ format_to()

template<typename OutputIt , typename Locale , typename... T, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value && detail::is_locale< Locale >::value) >
FMT_INLINE auto format_to ( OutputIt  out,
const Locale &  loc,
format_string< T... >  fmt,
T &&...  args 
) -> OutputIt

Definition at line 4488 of file format.h.

◆ formatted_size()

template<typename Locale , typename... T, FMT_ENABLE_IF(detail::is_locale< Locale >::value) >
FMT_NODISCARD FMT_INLINE auto formatted_size ( const Locale &  loc,
format_string< T... >  fmt,
T &&...  args 
) -> size_t

Definition at line 4495 of file format.h.

◆ group_digits()

template<typename T >
auto group_digits ( value) -> group_digits_view<T>

\rst Returns a view that formats an integer value using ',' as a locale-independent thousands separator.

Example**::

fmt::print("{}", fmt::group_digits(12345)); Output: "12,345" \endrst

Definition at line 4147 of file format.h.

◆ join() [1/2]

template<typename It , typename Sentinel >
auto join ( It  begin,
Sentinel  end,
string_view  sep 
) -> join_view<It, Sentinel>

Returns a view that formats the iterator range [begin, end) with elements separated by sep.

Definition at line 4280 of file format.h.

◆ join() [2/2]

template<typename Range >
auto join ( Range &&  range,
string_view  sep 
) -> join_view<detail::iterator_t<Range>, detail::sentinel_t<Range>>

\rst Returns a view that formats range with elements separated by sep.

Example**::

std::vector<int> v = {1, 2, 3}; fmt::print("{}", fmt::join(v, ", ")); Output: "1, 2, 3"

fmt::join applies passed format specifiers to the range elements::

fmt::print("{:02}", fmt::join(v, ", ")); Output: "01, 02, 03" \endrst

Definition at line 4301 of file format.h.

◆ ptr() [1/3]

template<typename T >
auto ptr ( const std::shared_ptr< T > &  p) -> const void*

Definition at line 4075 of file format.h.

◆ ptr() [2/3]

template<typename T , typename Deleter >
auto ptr ( const std::unique_ptr< T, Deleter > &  p) -> const void*

Definition at line 4072 of file format.h.

◆ ptr() [3/3]

template<typename T >
auto ptr ( p) -> const void*

\rst Converts p to const void* for pointer formatting.

Example**::

auto s = fmt::format("{}", fmt::ptr(p)); \endrst

Definition at line 4067 of file format.h.

◆ report_system_error()

FMT_API void report_system_error ( int  error_code,
const char *  message 
)
noexcept

Definition at line 1421 of file format-inl.h.

◆ system_error()

template<typename... T>
auto system_error ( int  error_code,
format_string< T... >  fmt,
T &&...  args 
) -> std::system_error

\rst Constructs :class:std::system_error with a message formatted with fmt::format(fmt, args...). error_code* is a system error code as given by errno.

Example**::

This throws std::system_error with the description cannot open file 'madeup': No such file or directory or similar (system message may vary). const char* filename = "madeup"; std::FILE* file = std::fopen(filename, "r"); if (!file) throw fmt::system_error(errno, "cannot open file '{}'", filename); \endrst

Definition at line 3941 of file format.h.

◆ to_string() [1/3]

template<typename Char , size_t SIZE>
FMT_NODISCARD auto to_string ( const basic_memory_buffer< Char, SIZE > &  buf) -> std::basic_string<Char>

Definition at line 4336 of file format.h.

◆ to_string() [2/3]

template<typename T , FMT_ENABLE_IF(!std::is_integral< T >::value && !detail::has_format_as< T >::value) >
auto to_string ( const T &  value) -> std::string
inline

\rst Converts value to std::string using the default format for type T.

Example**::

#include <fmt/format.h>

std::string answer = fmt::to_string(42); \endrst

Definition at line 4319 of file format.h.

◆ to_string() [3/3]

template<typename T , FMT_ENABLE_IF(std::is_integral< T >::value) >
FMT_NODISCARD auto to_string ( value) -> std::string
inline

Definition at line 4326 of file format.h.

◆ underlying()

template<typename Enum >
constexpr auto underlying ( Enum  e) -> underlying_t<Enum>
constexprnoexcept

\rst Converts e to the underlying type.

Example**::

enum class color { red, green, blue }; auto s = fmt::format("{}", fmt::underlying(color::red)); \endrst

Definition at line 4090 of file format.h.

◆ vformat()

template<typename Locale , FMT_ENABLE_IF(detail::is_locale< Locale >::value) >
auto vformat ( const Locale &  loc,
string_view  fmt,
format_args  args 
) -> std::string
inline

Definition at line 4462 of file format.h.

◆ vformat_to()

template<typename OutputIt , typename Locale , FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value && detail::is_locale< Locale >::value) >
auto vformat_to ( OutputIt  out,
const Locale &  loc,
string_view  fmt,
format_args  args 
) -> OutputIt

Definition at line 4477 of file format.h.

◆ vsystem_error()

FMT_API auto vsystem_error ( int  error_code,
string_view  format_str,
format_args  args 
) -> std::system_error

Definition at line 147 of file format-inl.h.

formatter
Definition: core.h:1087
FMT_VISIBILITY
#define FMT_VISIBILITY(value)
Definition: core.h:194
remove_cvref_t
typename std::remove_cv< remove_reference_t< T > >::type remove_cvref_t
Definition: core.h:280
detail::type::char_type
@ char_type
FMT_MAYBE_UNUSED
#define FMT_MAYBE_UNUSED
Definition: format.h:150
FMT_CONSTEXPR
#define FMT_CONSTEXPR
Definition: core.h:105


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49