Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
format.h File Reference
#include <algorithm>
#include <cerrno>
#include <cmath>
#include <cstdint>
#include <limits>
#include <memory>
#include <stdexcept>
#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

class  detail::arg_formatter< OutputIt, Char >
 
class  detail::arg_formatter_base< OutputIt, Char, ErrorHandler >
 
struct  arg_join< It, Sentinel, Char >
 
struct  detail::arg_ref< Char >
 
struct  detail::auto_id
 
struct  detail::basic_data< T >
 
struct  basic_format_specs< Char >
 
class  basic_memory_buffer< T, SIZE, Allocator >
 
struct  detail::big_decimal_fp
 
class  bytes
 
struct  detail::arg_formatter_base< OutputIt, Char, ErrorHandler >::char_spec_handler
 
class  detail::char_specs_checker< ErrorHandler >
 
class  detail::compile_parse_context< Char, ErrorHandler >
 
class  detail::counting_iterator
 
struct  detail::arg_formatter_base< OutputIt, Char, ErrorHandler >::cstring_spec_handler
 
class  detail::cstring_type_checker< ErrorHandler >
 
class  detail::custom_formatter< Context >
 
struct  detail::data
 
struct  detail::dragonbox::decimal_fp< T >
 
struct  detail::default_arg_formatter< OutputIt, Char >
 
struct  detail::divtest_table_entry< T >
 
struct  detail::dynamic_format_specs< Char >
 
class  dynamic_formatter< Char >
 
class  detail::dynamic_specs_handler< ParseContext >
 
struct  detail::fallback_uintptr
 
struct  detail::fill_t< Char >
 
struct  detail::dragonbox::float_info< T >
 
struct  detail::dragonbox::float_info< double >
 
struct  detail::dragonbox::float_info< float >
 
struct  detail::float_specs
 
struct  detail::format_decimal_result< Iterator >
 
class  format_error
 
struct  detail::format_handler< ArgFormatter, Char, Context >
 
class  format_int
 
class  detail::format_string_checker< Char, ErrorHandler, Args >
 
struct  formatter< arg_join< It, Sentinel, Char >, Char >
 
struct  formatter< bytes >
 
struct  formatter< Char[N], Char >
 
struct  formatter< T, Char, enable_if_t< detail::type_constant< T, Char >::value!=detail::type::custom_type > >
 
struct  formatter< void *, Char >
 
struct  detail::id_adapter< Handler, Char >
 
class  detail::int_type_checker< ErrorHandler >
 
struct  detail::int_writer< OutputIt, Char, UInt >
 
struct  is_contiguous< basic_memory_buffer< T, SIZE, Allocator > >
 
struct  detail::is_integral< T >
 
struct  detail::is_integral< int128_t >
 
struct  detail::is_integral< uint128_t >
 
struct  detail::null< T >
 
struct  dynamic_formatter< Char >::null_handler
 
class  detail::numeric_specs_checker< ErrorHandler >
 
struct  detail::precision_adapter< SpecHandler, Char >
 
class  detail::precision_checker< ErrorHandler >
 
class  detail::specs_checker< Handler >
 
class  detail::specs_handler< ParseContext, Context >
 
class  detail::specs_setter< Char >
 
class  system_error
 
class  detail::truncating_iterator< OutputIt, Enable >
 
class  detail::truncating_iterator< OutputIt, std::false_type >
 
class  detail::truncating_iterator< OutputIt, std::true_type >
 
class  detail::truncating_iterator_base< OutputIt >
 
struct  detail::uint128_wrapper
 
class  detail::utf8_to_utf16
 
union  detail::arg_ref< Char >::value
 
struct  detail::counting_iterator::value_type
 
struct  detail::width_adapter< SpecHandler, Char >
 
class  detail::width_checker< ErrorHandler >
 
struct  detail::write_int_data< Char >
 

Namespaces

 align
 
 detail
 
 detail::dragonbox
 
 sign
 

Macros

#define FMT_ALWAYS_INLINE   inline
 
#define FMT_CATCH(x)   catch (x)
 
#define FMT_CUDA_VERSION   0
 
#define FMT_DEPRECATED_NUMERIC_ALIGN   0
 
#define FMT_FALLTHROUGH
 
#define FMT_FORMAT_AS(Type, Base)
 
#define FMT_FUNC
 
#define FMT_HAS_BUILTIN(x)   0
 
#define FMT_ICC_VERSION   0
 
#define FMT_MAYBE_UNUSED
 
#define FMT_NOINLINE
 
#define FMT_REDUCE_INT_INSTANTIATIONS   0
 
#define FMT_SAFEBUFFERS
 
#define FMT_STRING(s)   FMT_STRING_IMPL(s, fmt::compile_string)
 
#define FMT_STRING_IMPL(s, base)
 
#define FMT_THROW(x)   throw x
 
#define FMT_TRY   try
 
#define FMT_USE_DOUBLE   1
 
#define FMT_USE_FLOAT   1
 
#define FMT_USE_FULL_CACHE_DRAGONBOX   0
 
#define FMT_USE_LONG_DOUBLE   1
 
#define FMT_USE_UDL_TEMPLATE   0
 
#define FMT_USE_USER_DEFINED_LITERALS   0
 

Typedefs

using align_t = align::type
 
template<typename T >
using detail::checked_ptr = T *
 
using FMT_DEPRECATED_ALIAS = detail::arg_formatter< OutputIt, Char >
 
template<typename OutputIt , typename Char = char>
using format_args_t = basic_format_args< format_context_t< OutputIt, Char >>
 
template<typename OutputIt , typename Char = char>
using format_context_t = basic_format_context< OutputIt, Char >
 
using detail::format_func = void(*)(detail::buffer< char > &, int, string_view)
 
using format_specs = basic_format_specs< char >
 
template<typename T >
using detail::is_fast_float = bool_constant< std::numeric_limits< T >::is_iec559 &&sizeof(T)<=sizeof(double)>
 
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_t >::value >
 
template<typename T >
using detail::iterator_t = decltype(std::begin(std::declval< T & >()))
 
using memory_buffer = basic_memory_buffer< char >
 
template<typename InputIt , typename OutChar >
using detail::needs_conversion = bool_constant< std::is_same< typename std::iterator_traits< InputIt >::value_type, char >::value &&std::is_same< OutChar, char8_type >::value >
 
template<typename T >
using detail::sentinel_t = decltype(std::end(std::declval< T & >()))
 
using sign_t = sign::type
 
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 >>
 
using detail::uintptr_t = fallback_uintptr
 
using wmemory_buffer = basic_memory_buffer< wchar_t >
 

Enumerations

enum  { inline_buffer_size = 500 }
 
enum  detail::arg_id_kind { detail::arg_id_kind::none, detail::arg_id_kind::index, detail::arg_id_kind::name }
 
enum  detail::float_format : unsigned char { detail::float_format::general, detail::float_format::exp, detail::float_format::fixed, detail::float_format::hex }
 
enum  align::type {
  align::none, align::left, align::right, align::center,
  align::numeric
}
 
enum  sign::type { sign::none, sign::minus, sign::plus, sign::space }
 

Functions

template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR void advance_to (basic_format_parse_context< Char, ErrorHandler > &ctx, const Char *p)
 
FMT_INLINE void detail::assume (bool condition)
 
template<typename Container , FMT_ENABLE_IF(is_contiguous< Container >::value) >
std::back_insert_iterator< Container > detail::base_iterator (std::back_insert_iterator< Container > &it, checked_ptr< typename Container::value_type >)
 
template<typename Iterator >
Iterator detail::base_iterator (Iterator, Iterator it)
 
template<typename Dest , typename Source >
Dest detail::bit_cast (const Source &source)
 
FMT_INLINE uint16_t detail::bsr2log10 (int bsr)
 
template<typename... , typename S , FMT_ENABLE_IF(is_compile_string< S >::value) >
void detail::check_format_string (S)
 
template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR void detail::check_pointer_type_spec (Char spec, ErrorHandler &&eh)
 
template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR void detail::check_string_type_spec (Char spec, ErrorHandler &&eh)
 
template<typename Char >
size_t detail::code_point_index (basic_string_view< Char > s, size_t n)
 
size_t detail::code_point_index (basic_string_view< char8_type > s, size_t n)
 
template<typename Char , size_t N>
FMT_CONSTEXPR basic_string_view< Char > detail::compile_string_to_view (const Char(&s)[N])
 
template<typename Char >
FMT_CONSTEXPR basic_string_view< Char > detail::compile_string_to_view (const std_string_view< Char > &s)
 
template<typename Char >
void detail::copy2 (Char *dst, const char *src)
 
FMT_INLINE void detail::copy2 (char *dst, const char *src)
 
template<typename OutChar , typename InputIt , typename OutputIt , FMT_ENABLE_IF(!needs_conversion< InputIt, OutChar >::value) >
OutputIt detail::copy_str (InputIt begin, InputIt end, OutputIt it)
 
template<typename Char , typename InputIt >
counting_iterator detail::copy_str (InputIt begin, InputIt end, counting_iterator it)
 
template<typename Char >
size_t detail::count_code_points (basic_string_view< Char > s)
 
size_t detail::count_code_points (basic_string_view< char > s)
 
size_t detail::count_code_points (basic_string_view< char8_type > s)
 
int detail::count_digits (uint64_t n)
 
template<unsigned BITS, typename UInt >
int detail::count_digits (UInt n)
 
template<>
int detail::count_digits< 4 > (detail::fallback_uintptr n)
 
template<typename Char >
Char detail::decimal_point (locale_ref loc)
 
template<>
wchar_t detail::decimal_point (locale_ref loc)
 
template<typename Char >
FMT_FUNC Char detail::decimal_point_impl (locale_ref loc)
 
template<typename Char >
FMT_API Char detail::decimal_point_impl (locale_ref loc)
 
template<typename Int >
constexpr int detail::digits10 () FMT_NOEXCEPT
 
template<>
constexpr int detail::digits10< int128_t > () FMT_NOEXCEPT
 
template<>
constexpr int detail::digits10< uint128_t > () FMT_NOEXCEPT
 
template<typename Char >
bool detail::equal2 (const Char *lhs, const char *rhs)
 
bool detail::equal2 (const char *lhs, const char *rhs)
 
template<typename T >
constexpr dragonbox::float_info< T >::carrier_uint detail::exponent_mask ()
 
template<typename OutputIt , typename Char >
FMT_NOINLINE OutputIt detail::fill (OutputIt it, size_t n, const fill_t< Char > &fill)
 
template<bool IS_CONSTEXPR, typename T , typename Ptr = const T*>
FMT_CONSTEXPR bool detail::find (Ptr first, Ptr last, T value, Ptr &out)
 
template<>
bool detail::find< false, char > (const char *first, const char *last, char value, const char *&out)
 
template<typename S , typename Char = char_t<S>, FMT_ENABLE_IF(detail::is_string< S >::value) >
 FMT_BUFFER_CONTEXT (Char)
 
 FMT_FORMAT_AS (signed char, int)
 
 FMT_FORMAT_AS (unsigned char, unsigned)
 
 FMT_FORMAT_AS (short, int)
 
 FMT_FORMAT_AS (long, long long)
 
 FMT_FORMAT_AS (unsigned long, unsigned long long)
 
 FMT_FORMAT_AS (Char *, const Char *)
 
 FMT_FORMAT_AS (std::basic_string< Char >, basic_string_view< Char >)
 
 FMT_FORMAT_AS (std::nullptr_t, const void *)
 
 FMT_FORMAT_AS (detail::std_string_view< Char >, basic_string_view< Char >)
 
template<typename Char , typename UInt >
format_decimal_result< Char * > detail::format_decimal (Char *out, UInt value, int size)
 
template<typename Char , typename UInt , typename Iterator , FMT_ENABLE_IF(!std::is_pointer< remove_cvref_t< Iterator >>::value) >
format_decimal_result< Iterator > detail::format_decimal (Iterator out, UInt value, int size)
 
FMT_FUNC void detail::format_error_code (detail::buffer< char > &out, int error_code, string_view message) FMT_NOEXCEPT
 
template<typename T >
int detail::format_float (T value, int precision, float_specs specs, buffer< char > &buf)
 
template int detail::format_float< double > (double value, int precision, float_specs specs, buffer< char > &buf)
 
template int detail::format_float< long double > (long double value, int precision, float_specs specs, buffer< char > &buf)
 
FMT_API void format_system_error (detail::buffer< char > &out, int error_code, string_view message) FMT_NOEXCEPT
 
template<typename S , typename... Args, size_t SIZE = inline_buffer_size, typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
buffer_context< Char >::iterator format_to (basic_memory_buffer< Char, SIZE > &buf, const S &format_str, Args &&...args)
 
template<unsigned BASE_BITS, typename Char , typename UInt >
Char * detail::format_uint (Char *buffer, UInt value, int num_digits, bool upper=false)
 
template<unsigned BASE_BITS, typename Char >
Char * detail::format_uint (Char *buffer, detail::fallback_uintptr n, int num_digits, bool=false)
 
template<unsigned BASE_BITS, typename Char , typename It , typename UInt >
It detail::format_uint (It out, UInt value, int num_digits, bool upper=false)
 
template<typename Context , typename ID >
FMT_CONSTEXPR Context::format_arg detail::get_arg (Context &ctx, ID id)
 
template<typename Char >
Char * detail::get_data (std::basic_string< Char > &s)
 
template<typename Container >
Container::value_type * detail::get_data (Container &c)
 
template<template< typename > class Handler, typename FormatArg , typename ErrorHandler >
FMT_CONSTEXPR int detail::get_dynamic_spec (FormatArg arg, ErrorHandler eh)
 
int detail::get_significand_size (const big_decimal_fp &fp)
 
template<typename T >
int detail::get_significand_size (const dragonbox::decimal_fp< T > &fp)
 
template<typename Char >
std::string detail::grouping (locale_ref loc)
 
template<>
std::string detail::grouping< wchar_t > (locale_ref loc)
 
template<typename Char >
FMT_API std::string detail::grouping_impl (locale_ref loc)
 
template FMT_API std::string detail::grouping_impl< char > (locale_ref loc)
 
template FMT_API std::string detail::grouping_impl< wchar_t > (locale_ref loc)
 
template<typename Char , typename Handler >
FMT_CONSTEXPR void detail::handle_char_specs (const basic_format_specs< Char > *specs, Handler &&handler)
 
template<typename Char , typename Handler >
FMT_CONSTEXPR void detail::handle_cstring_type_spec (Char spec, Handler &&handler)
 
template<template< typename > class Handler, typename Context >
void detail::handle_dynamic_spec (int &value, arg_ref< typename Context::char_type > ref, Context &ctx)
 
template<typename Handler >
FMT_CONSTEXPR void detail::handle_int_type_spec (char spec, Handler &&handler)
 
bool detail::is_big_endian ()
 
template<typename Char >
FMT_CONSTEXPR bool detail::is_name_start (Char c)
 
template<typename T , FMT_ENABLE_IF(is_signed< T >::value) >
FMT_CONSTEXPR bool detail::is_negative (T value)
 
template<typename T , FMT_ENABLE_IF(std::is_floating_point< T >::value) >
FMT_CONSTEXPR bool detail::is_supported_floating_point (T)
 
template<typename It , typename Sentinel >
arg_join< It, Sentinel, char > join (It begin, Sentinel end, string_view sep)
 
template<typename It , typename Sentinel >
arg_join< It, Sentinel, wchar_t > join (It begin, Sentinel end, wstring_view sep)
 
template<typename Range >
arg_join< detail::iterator_t< Range >, detail::sentinel_t< Range >, char > join (Range &&range, string_view sep)
 
template<typename Range >
arg_join< detail::iterator_t< Range >, detail::sentinel_t< Range >, wchar_t > join (Range &&range, wstring_view sep)
 
template<typename T >
T * detail::make_checked (T *p, size_t)
 
template<typename OutputIt , typename Char , typename... Args>
FMT_DEPRECATED format_arg_store< buffer_context< Char >, Args... > make_format_to_n_args (const Args &...args)
 
template<typename T >
constexpr T detail::max_value ()
 
template<typename Char >
FMT_CONSTEXPR const Char * detail::next_code_point (const Char *begin, const Char *end)
 
template<typename T >
constexpr int detail::num_bits ()
 
template<>
constexpr int detail::num_bits< fallback_uintptr > ()
 
template<>
constexpr int detail::num_bits< int128_t > ()
 
template<>
constexpr int detail::num_bits< uint128_t > ()
 
template<typename Char , typename Handler >
FMT_CONSTEXPR const Char * detail::parse_align (const Char *begin, const Char *end, Handler &&handler)
 
template<typename Char , typename IDHandler >
FMT_CONSTEXPR const Char * detail::parse_arg_id (const Char *begin, const Char *end, IDHandler &&handler)
 
template<typename ErrorHandler = error_handler, typename Char >
FMT_CONSTEXPR float_specs detail::parse_float_type_spec (const basic_format_specs< Char > &specs, ErrorHandler &&eh={})
 
template<typename Char , typename SpecHandler >
FMT_CONSTEXPR const Char * detail::parse_format_specs (const Char *begin, const Char *end, SpecHandler &&handler)
 
template<typename T , typename ParseContext >
FMT_CONSTEXPR const ParseContext::char_type * detail::parse_format_specs (ParseContext &ctx)
 
template<bool IS_CONSTEXPR, typename Char , typename Handler >
FMT_CONSTEXPR_DECL FMT_INLINE void detail::parse_format_string (basic_string_view< Char > format_str, Handler &&handler)
 
template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR int detail::parse_nonnegative_int (const Char *&begin, const Char *end, ErrorHandler &&eh)
 
template<typename Char , typename Handler >
FMT_CONSTEXPR const Char * detail::parse_precision (const Char *begin, const Char *end, Handler &&handler)
 
template<typename Char , typename Handler >
FMT_CONSTEXPR const Char * detail::parse_replacement_field (const Char *begin, const Char *end, Handler &&handler)
 
template<typename Char , typename Handler >
FMT_CONSTEXPR const Char * detail::parse_width (const Char *begin, const Char *end, Handler &&handler)
 
template<typename T >
detail::promote_float (T value)
 
double detail::promote_float (float value)
 
template<typename T >
const void * ptr (const T *p)
 
template<typename T >
const void * ptr (const std::unique_ptr< T > &p)
 
template<typename T >
const void * ptr (const std::shared_ptr< T > &p)
 
FMT_FUNC void detail::report_error (format_func func, int error_code, string_view message) FMT_NOEXCEPT
 
FMT_API void report_system_error (int error_code, string_view message) FMT_NOEXCEPT
 
template<typename Container , FMT_ENABLE_IF(is_contiguous< Container >::value) >
checked_ptr< typename Container::value_type > detail::reserve (std::back_insert_iterator< Container > it, size_t n)
 
template<typename T >
buffer_appender< T > detail::reserve (buffer_appender< T > it, size_t n)
 
template<typename Iterator >
Iterator & detail::reserve (Iterator &it, size_t)
 
template<typename T >
int detail::snprintf_float (T value, int precision, float_specs specs, buffer< char > &buf)
 
int detail::snprintf_float (float value, int precision, float_specs specs, buffer< char > &buf)=delete
 
template int detail::snprintf_float< double > (double value, int precision, float_specs specs, buffer< char > &buf)
 
template int detail::snprintf_float< long double > (long double value, int precision, float_specs specs, buffer< char > &buf)
 
template<typename Char >
Char detail::thousands_sep (locale_ref loc)
 
template<>
wchar_t detail::thousands_sep (locale_ref loc)
 
template<typename Char >
FMT_API Char detail::thousands_sep_impl (locale_ref loc)
 
template FMT_API char detail::thousands_sep_impl< char > (locale_ref loc)
 
template FMT_API wchar_t detail::thousands_sep_impl< wchar_t > (locale_ref loc)
 
template<typename T >
decimal_fp< T > detail::dragonbox::to_decimal (T x) FMT_NOEXCEPT
 
template<typename Char , FMT_ENABLE_IF(std::is_integral< Char >::value) >
constexpr Char detail::to_integral (Char value)
 
template<typename Char , FMT_ENABLE_IF(std::is_enum< Char >::value) >
constexpr std::underlying_type< Char >::type detail::to_integral (Char value)
 
template<typename T , typename OutputIt >
constexpr T * detail::to_pointer (OutputIt, size_t)
 
template<typename T >
T * detail::to_pointer (buffer_appender< T > it, size_t n)
 
template<typename T , FMT_ENABLE_IF(!std::is_integral< T >::value) >
std::string to_string (const T &value)
 
template<typename T , FMT_ENABLE_IF(std::is_integral< T >::value) >
std::string to_string (T value)
 
template<typename Char , size_t SIZE>
std::basic_string< Char > to_string (const basic_memory_buffer< Char, SIZE > &buf)
 
fallback_uintptr detail::to_uintptr (const void *p)
 
template<typename T >
std::wstring to_wstring (const T &value)
 
template<typename ArgFormatter , typename Char , typename Context >
Context::iterator vformat_to (typename ArgFormatter::iterator out, basic_string_view< Char > format_str, basic_format_args< Context > args, detail::locale_ref loc=detail::locale_ref())
 
template<typename Char , FMT_ENABLE_IF(std::is_same< Char, wchar_t >::value) >
void vprint (std::FILE *f, basic_string_view< Char > format_str, wformat_args args)
 
template<typename Char , FMT_ENABLE_IF(std::is_same< Char, wchar_t >::value) >
void vprint (basic_string_view< Char > format_str, wformat_args args)
 
template<typename StrChar , typename Char , typename OutputIt >
OutputIt detail::write (OutputIt out, basic_string_view< StrChar > s, const basic_format_specs< Char > &specs)
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(std::is_floating_point< T >::value) >
OutputIt detail::write (OutputIt out, T value, basic_format_specs< Char > specs, locale_ref loc={})
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(is_fast_float< T >::value) >
OutputIt detail::write (OutputIt out, T value)
 
template<typename Char , typename OutputIt >
OutputIt detail::write (OutputIt out, monostate)
 
template<typename Char , typename OutputIt , FMT_ENABLE_IF(!std::is_same< Char, char >::value) >
OutputIt detail::write (OutputIt out, string_view value)
 
template<typename Char , typename OutputIt >
OutputIt detail::write (OutputIt out, basic_string_view< Char > value)
 
template<typename Char >
buffer_appender< Char > detail::write (buffer_appender< Char > out, basic_string_view< Char > value)
 
template<typename Char , typename OutputIt >
OutputIt detail::write (OutputIt out, bool value)
 
template<typename Char , typename OutputIt >
OutputIt detail::write (OutputIt out, Char value)
 
template<typename Char , typename OutputIt >
OutputIt detail::write (OutputIt out, const Char *value)
 
template<typename Char , typename OutputIt >
OutputIt detail::write (OutputIt out, const void *value)
 
template<typename Char , typename OutputIt , typename T >
auto detail::write (OutputIt out, const T &value) -> typename std::enable_if< mapped_type_constant< T, basic_format_context< OutputIt, Char >>::value==type::custom_type, OutputIt >::type
 
template<typename Char , typename OutputIt >
OutputIt detail::write_bytes (OutputIt out, string_view bytes, const basic_format_specs< Char > &specs)
 
template<typename Char , typename OutputIt >
OutputIt detail::write_char (OutputIt out, Char value, const basic_format_specs< Char > &specs)
 
template<typename Char , typename It >
It detail::write_exponent (int exp, It it)
 
template<typename OutputIt , typename DecimalFP , typename Char >
OutputIt detail::write_float (OutputIt out, const DecimalFP &fp, const basic_format_specs< Char > &specs, float_specs fspecs, Char decimal_point)
 
template<typename OutputIt , typename Char , typename F >
OutputIt detail::write_int (OutputIt out, int num_digits, string_view prefix, const basic_format_specs< Char > &specs, F f)
 
template<typename Char , typename OutputIt >
OutputIt detail::write_nonfinite (OutputIt out, bool isinf, const basic_format_specs< Char > &specs, const float_specs &fspecs)
 
template<align::type align = align::left, typename OutputIt , typename Char , typename F >
OutputIt detail::write_padded (OutputIt out, const basic_format_specs< Char > &specs, size_t size, size_t width, F &&f)
 
template<align::type align = align::left, typename OutputIt , typename Char , typename F >
OutputIt detail::write_padded (OutputIt out, const basic_format_specs< Char > &specs, size_t size, F &&f)
 
template<typename Char , typename OutputIt , typename UIntPtr >
OutputIt detail::write_ptr (OutputIt out, UIntPtr value, const basic_format_specs< Char > *specs)
 
template<typename Char , typename OutputIt >
OutputIt detail::write_significand (OutputIt out, const char *significand, int &significand_size)
 
template<typename Char , typename OutputIt , typename UInt >
OutputIt detail::write_significand (OutputIt out, UInt significand, int significand_size)
 
template<typename Char , typename UInt , FMT_ENABLE_IF(std::is_integral< UInt >::value) >
Char * detail::write_significand (Char *out, UInt significand, int significand_size, int integral_size, Char decimal_point)
 
template<typename OutputIt , typename UInt , typename Char , FMT_ENABLE_IF(!std::is_pointer< remove_cvref_t< OutputIt >>::value) >
OutputIt detail::write_significand (OutputIt out, UInt significand, int significand_size, int integral_size, Char decimal_point)
 
template<typename OutputIt , typename Char >
OutputIt detail::write_significand (OutputIt out, const char *significand, int significand_size, int integral_size, Char decimal_point)
 

Variables

FMT_EXTERN template struct detail::basic_data< void >
 

Macro Definition Documentation

#define FMT_ALWAYS_INLINE   inline

Definition at line 973 of file format.h.

#define FMT_CATCH (   x)    catch (x)

Definition at line 126 of file format.h.

#define FMT_CUDA_VERSION   0

Definition at line 57 of file format.h.

#define FMT_DEPRECATED_NUMERIC_ALIGN   0

Definition at line 272 of file format.h.

#define FMT_FALLTHROUGH

Definition at line 87 of file format.h.

#define FMT_FORMAT_AS (   Type,
  Base 
)
Value:
template <typename Char> \
template <typename FormatContext> \
auto format(Type const& val, FormatContext& ctx) -> decltype(ctx.out()) { \
return formatter<Base, Char>::format(val, ctx); \
} \
}
FMT_INLINE std::basic_string< Char > format(const S &format_str, Args &&...args)
Definition: core.h:2081

Definition at line 3469 of file format.h.

#define FMT_FUNC

Definition at line 3950 of file format.h.

#define FMT_HAS_BUILTIN (   x)    0

Definition at line 63 of file format.h.

#define FMT_ICC_VERSION   0

Definition at line 51 of file format.h.

#define FMT_MAYBE_UNUSED

Definition at line 94 of file format.h.

#define FMT_NOINLINE

Definition at line 69 of file format.h.

#define FMT_REDUCE_INT_INSTANTIATIONS   0

Definition at line 174 of file format.h.

#define FMT_SAFEBUFFERS

Definition at line 980 of file format.h.

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

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");

Definition at line 3165 of file format.h.

#define FMT_STRING_IMPL (   s,
  base 
)
Value:
[] { \
/* Use a macro-like name to avoid shadowing warnings. */ \
struct FMT_COMPILE_STRING : base { \
using char_type = fmt::remove_cvref_t<decltype(s[0])>; \
FMT_MAYBE_UNUSED FMT_CONSTEXPR \
operator fmt::basic_string_view<char_type>() const { \
return fmt::detail::compile_string_to_view<char_type>(s); \
} \
}; \
return FMT_COMPILE_STRING(); \
}()
#define FMT_MAYBE_UNUSED
Definition: format.h:94

Definition at line 3142 of file format.h.

#define FMT_THROW (   x)    throw x

Definition at line 113 of file format.h.

#define FMT_TRY   try

Definition at line 125 of file format.h.

#define FMT_USE_DOUBLE   1

Definition at line 162 of file format.h.

#define FMT_USE_FLOAT   1

Definition at line 158 of file format.h.

#define FMT_USE_FULL_CACHE_DRAGONBOX   0

Definition at line 595 of file format.h.

#define FMT_USE_LONG_DOUBLE   1

Definition at line 166 of file format.h.

#define FMT_USE_UDL_TEMPLATE   0

Definition at line 153 of file format.h.

#define FMT_USE_USER_DEFINED_LITERALS   0

Definition at line 139 of file format.h.

Typedef Documentation

Definition at line 1176 of file format.h.

Definition at line 3248 of file format.h.

template<typename OutputIt , typename Char = char>
using format_args_t = basic_format_args<format_context_t<OutputIt, Char>>

Definition at line 3822 of file format.h.

template<typename OutputIt , typename Char = char>
using format_context_t = basic_format_context<OutputIt, Char>

Definition at line 3819 of file format.h.

Definition at line 1203 of file format.h.

Definition at line 761 of file format.h.

using sign_t = sign::type

Definition at line 1181 of file format.h.

Definition at line 762 of file format.h.

Enumeration Type Documentation

anonymous enum
Enumerator
inline_buffer_size 

Definition at line 621 of file format.h.

Function Documentation

template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR void advance_to ( basic_format_parse_context< Char, ErrorHandler > &  ctx,
const Char *  p 
)

Definition at line 3577 of file format.h.

template<typename S , typename Char = char_t<S>, FMT_ENABLE_IF(detail::is_string< S >::value) >
FMT_BUFFER_CONTEXT ( Char  )
inline

Definition at line 3804 of file format.h.

FMT_FORMAT_AS ( signed  char,
int   
)
FMT_FORMAT_AS ( unsigned  char,
unsigned   
)
FMT_FORMAT_AS ( short  ,
int   
)
FMT_FORMAT_AS ( long  ,
long  long 
)
FMT_FORMAT_AS ( unsigned  long,
unsigned long  long 
)
FMT_FORMAT_AS ( Char *  ,
const Char *   
)
FMT_FORMAT_AS ( std::basic_string< Char >  ,
basic_string_view< Char >   
)
FMT_FORMAT_AS ( std::nullptr_t  ,
const void *   
)
FMT_FORMAT_AS ( detail::std_string_view< Char >  ,
basic_string_view< Char >   
)
FMT_API void format_system_error ( detail::buffer< char > &  out,
int  error_code,
string_view  message 
)

Formats an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out in the following form:

.. 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. If error_code is not a valid error code such as -1, the system message may look like "Unknown error -1" and is platform-dependent.

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

template<typename S , typename... Args, size_t SIZE = inline_buffer_size, typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
buffer_context<Char>::iterator format_to ( basic_memory_buffer< Char, SIZE > &  buf,
const S &  format_str,
Args &&...  args 
)
inline

Definition at line 3812 of file format.h.

template<typename It , typename Sentinel >
arg_join<It, Sentinel, char> join ( It  begin,
Sentinel  end,
string_view  sep 
)

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

Definition at line 3688 of file format.h.

template<typename It , typename Sentinel >
arg_join<It, Sentinel, wchar_t> join ( It  begin,
Sentinel  end,
wstring_view  sep 
)

Definition at line 3693 of file format.h.

template<typename Range >
arg_join<detail::iterator_t<Range>, detail::sentinel_t<Range>, char> join ( Range &&  range,
string_view  sep 
)

Returns an object 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"

Definition at line 3714 of file format.h.

template<typename Range >
arg_join<detail::iterator_t<Range>, detail::sentinel_t<Range>, wchar_t> join ( Range &&  range,
wstring_view  sep 
)

Definition at line 3720 of file format.h.

template<typename OutputIt , typename Char , typename... Args>
FMT_DEPRECATED format_arg_store<buffer_context<Char>, Args...> make_format_to_n_args ( const Args &...  args)

Definition at line 3833 of file format.h.

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

Converts p to const void* for pointer formatting.

Example**::

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

Definition at line 3610 of file format.h.

template<typename T >
const void* ptr ( const std::unique_ptr< T > &  p)
inline

Definition at line 3611 of file format.h.

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

Definition at line 3614 of file format.h.

FMT_API void report_system_error ( int  error_code,
string_view  message 
)
template<typename T , FMT_ENABLE_IF(!std::is_integral< T >::value) >
std::string to_string ( const T &  value)
inline

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

Example**::

#include <fmt/format.h>

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

Definition at line 3737 of file format.h.

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

Definition at line 3744 of file format.h.

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

Definition at line 3761 of file format.h.

template<typename T >
std::wstring to_wstring ( const T &  value)
inline

Converts value to std::wstring using the default format for type T.

Definition at line 3756 of file format.h.

template<typename ArgFormatter , typename Char , typename Context >
Context::iterator vformat_to ( typename ArgFormatter::iterator  out,
basic_string_view< Char >  format_str,
basic_format_args< Context >  args,
detail::locale_ref  loc = detail::locale_ref() 
)

Formats arguments and writes the output to the range.

Definition at line 3584 of file format.h.

template<typename Char , FMT_ENABLE_IF(std::is_same< Char, wchar_t >::value) >
void vprint ( std::FILE *  f,
basic_string_view< Char >  format_str,
wformat_args  args 
)

Definition at line 3847 of file format.h.

template<typename Char , FMT_ENABLE_IF(std::is_same< Char, wchar_t >::value) >
void vprint ( basic_string_view< Char >  format_str,
wformat_args  args 
)

Definition at line 3857 of file format.h.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:48