Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
format.h File Reference
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <limits>
#include <memory>
#include <stdexcept>
#include <stdint.h>
#include "core.h"

Go to the source code of this file.

Classes

struct  internal::function< Result >
 
struct  internal::function< Result >::result< T >
 
struct  internal::dummy_int
 
class  std::numeric_limits< fmt::internal::dummy_int >
 
class  basic_writer< Range >
 
class  output_range< OutputIt, T >
 
class  back_insert_range< Container >
 
class  format_error
 
struct  internal::checked< T >
 
class  u8string_view
 
class  basic_memory_buffer< T, SIZE, Allocator >
 
struct  internal::char_traits< Char >
 
struct  internal::char_traits< char >
 
struct  internal::char_traits< wchar_t >
 
class  internal::null_terminating_iterator< Char >
 
class  internal::counting_iterator< T >
 
class  internal::truncating_iterator_base< OutputIt >
 
class  internal::truncating_iterator< OutputIt, Enable >
 
class  internal::truncating_iterator< OutputIt, std::false_type >
 
class  internal::truncating_iterator< OutputIt, std::true_type >
 
struct  internal::int_traits< T >
 
struct  internal::basic_data< T >
 
struct  internal::needs_conversion< InputIt, OutChar >
 
class  internal::decimal_formatter
 
class  internal::decimal_formatter_null
 
struct  internal::no_thousands_sep
 
class  internal::add_thousands_sep< Char >
 
struct  internal::null< T >
 
struct  align_spec
 
struct  core_format_specs
 
struct  basic_format_specs< Char >
 
class  internal::int_type_checker< ErrorHandler >
 
class  internal::float_type_checker< ErrorHandler >
 
class  internal::char_specs_checker< ErrorHandler >
 
class  internal::cstring_type_checker< ErrorHandler >
 
class  internal::arg_formatter_base< Range >
 
struct  internal::arg_formatter_base< Range >::char_writer
 
struct  internal::arg_formatter_base< Range >::char_spec_handler
 
struct  internal::arg_formatter_base< Range >::cstring_spec_handler
 
class  internal::custom_formatter< Char, Context >
 
struct  internal::is_integer< T >
 
class  internal::width_checker< ErrorHandler >
 
class  internal::precision_checker< ErrorHandler >
 
class  internal::specs_setter< Char >
 
class  internal::specs_checker< Handler >
 
struct  internal::auto_id
 
class  internal::specs_handler< Context >
 
struct  internal::arg_ref< Char >
 
struct  internal::dynamic_format_specs< Char >
 
class  internal::dynamic_specs_handler< ParseContext >
 
struct  internal::width_adapter< SpecHandler, Char >
 
struct  internal::precision_adapter< SpecHandler, Char >
 
struct  internal::id_adapter< Handler, Char >
 
class  internal::format_string_checker< Char, ErrorHandler, Args >
 
struct  internal::format_type< Context, T >
 
class  arg_formatter< Range >
 
class  system_error
 
class  basic_writer< Range >
 
struct  basic_writer< Range >::padded_int_writer< F >
 
struct  basic_writer< Range >::int_writer< Int, Spec >
 
struct  basic_writer< Range >::int_writer< Int, Spec >::dec_writer
 
struct  basic_writer< Range >::int_writer< Int, Spec >::hex_writer
 
struct  basic_writer< Range >::int_writer< Int, Spec >::bin_writer< BITS >
 
struct  basic_writer< Range >::int_writer< Int, Spec >::num_writer
 
struct  basic_writer< Range >::inf_or_nan_writer
 
struct  basic_writer< Range >::double_writer
 
struct  basic_writer< Range >::str_writer< Char >
 
struct  float_spec_handler
 
class  format_int
 
struct  formatter< T, Char, typename std::enable_if< internal::format_type< typename buffer_context< Char >::type, T >::value >::type >
 
class  dynamic_formatter< Char >
 
struct  dynamic_formatter< Char >::null_handler
 
struct  format_handler< ArgFormatter, Char, Context >
 
struct  arg_join< It, Char >
 
struct  formatter< arg_join< It, Char >, Char >
 
struct  internal::void_< Ts >
 
struct  internal::it_category< T, Enable >
 
struct  internal::it_category< T * >
 
struct  internal::it_category< T, typename void_< typename T::iterator_category >::type >
 
class  internal::is_output_iterator< It >
 
struct  format_context_t< OutputIt, Char >
 
struct  format_args_t< OutputIt, Char >
 
struct  format_to_n_result< OutputIt >
 
struct  format_to_n_context< OutputIt, Char >
 
struct  format_to_n_args< OutputIt, Char >
 

Namespaces

 internal
 

Macros

#define FMT_CLANG_VERSION   0
 
#define FMT_ICC_VERSION   0
 
#define FMT_CUDA_VERSION   0
 
#define FMT_SECURE_SCL   0
 
#define FMT_HAS_BUILTIN(x)   0
 
#define FMT_THROW(x)   throw x
 
#define FMT_USE_USER_DEFINED_LITERALS   0
 
#define FMT_UDL_TEMPLATE   0
 
#define FMT_USE_EXTERN_TEMPLATES
 
#define FMT_USE_TRAILING_RETURN   0
 
#define FMT_USE_GRISU   0
 
#define FMT_ALWAYS_INLINE
 
#define FMT_USE_WINDOWS_H   0
 
#define FMT_STRING(s)
 
#define FMT_FUNC
 

Typedefs

typedef std::numeric_limits< internal::dummy_intinternal::fputil
 
typedef basic_writer< back_insert_range< internal::buffer > > writer
 
typedef basic_writer< back_insert_range< internal::wbuffer > > wwriter
 
typedef basic_memory_buffer< char > memory_buffer
 
typedef basic_memory_buffer< wchar_t > wmemory_buffer
 
typedef basic_data internal::data
 
typedef basic_format_specs< char > format_specs
 
typedef format_context_t< OutputIt, FMT_CHAR(S)>::type context
 

Enumerations

enum  char8_t : unsigned char
 
enum  { inline_buffer_size = 500 }
 
enum  alignment {
  ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER,
  ALIGN_NUMERIC
}
 
enum  { SIGN_FLAG = 1, PLUS_FLAG = 2, MINUS_FLAG = 4, HASH_FLAG = 8 }
 

Functions

template<typename Dest , typename Source >
Dest internal::bit_cast (const Source &source)
 
template<typename C >
FMT_CONSTEXPR auto internal::begin (const C &c) -> decltype(c.begin())
 
template<typename T , std::size_t N>
FMT_CONSTEXPR T * internal::begin (T(&array)[N]) FMT_NOEXCEPT
 
template<typename C >
FMT_CONSTEXPR auto internal::end (const C &c) -> decltype(c.end())
 
template<typename T , std::size_t N>
FMT_CONSTEXPR T * internal::end (T(&array)[N]) FMT_NOEXCEPT
 
dummy_int internal::isinf (...)
 
dummy_int internal::_finite (...)
 
dummy_int internal::isnan (...)
 
dummy_int internal::_isnan (...)
 
template<typename Allocator >
Allocator::value_type * internal::allocate (Allocator &alloc, std::size_t n)
 
template<typename T >
internal::const_check (T value)
 
template<typename T >
T * internal::make_checked (T *p, std::size_t)
 
template<typename Container >
std::enable_if< is_contiguous< Container >::value, typename checked< typename Container::value_type >::type >::type internal::reserve (std::back_insert_iterator< Container > &it, std::size_t n)
 
template<typename Iterator >
Iterator & internal::reserve (Iterator &it, std::size_t)
 
template<typename Char >
FMT_CONSTEXPR_DECL const Char * internal::pointer_from (null_terminating_iterator< Char > it)
 
template<typename T >
FMT_CONSTEXPR std::enable_if< std::numeric_limits< T >::is_signed, bool >::type internal::is_negative (T value)
 
template<typename T >
FMT_CONSTEXPR std::enable_if< !std::numeric_limits< T >::is_signed, bool >::type internal::is_negative (T)
 
int internal::count_digits (uint64_t n)
 
template<typename Char >
size_t internal::count_code_points (basic_string_view< Char > s)
 
FMT_API size_t internal::count_code_points (basic_string_view< char8_t > s)
 
char8_t internal::to_char8_t (char c)
 
template<typename OutChar , typename InputIt , typename OutputIt >
std::enable_if< !needs_conversion< InputIt, OutChar >::value, OutputIt >::type internal::copy_str (InputIt begin, InputIt end, OutputIt it)
 
template<typename OutChar , typename InputIt , typename OutputIt >
std::enable_if< needs_conversion< InputIt, OutChar >::value, OutputIt >::type internal::copy_str (InputIt begin, InputIt end, OutputIt it)
 
template<typename Handler >
char * internal::lg (uint32_t n, Handler h) FMT_ALWAYS_INLINE
 
template<typename Char >
FMT_API Char internal::thousands_sep_impl (locale_ref loc)
 
template<typename Char >
Char internal::thousands_sep (locale_ref loc)
 
template<>
wchar_t internal::thousands_sep (locale_ref loc)
 
template<typename UInt , typename Char , typename ThousandsSep >
Char * internal::format_decimal (Char *buffer, UInt value, int num_digits, ThousandsSep thousands_sep)
 
template<typename OutChar , typename UInt , typename Iterator , typename ThousandsSep >
Iterator internal::format_decimal (Iterator out, UInt value, int num_digits, ThousandsSep sep)
 
template<typename OutChar , typename It , typename UInt >
It internal::format_decimal (It out, UInt value, int num_digits)
 
template<unsigned BASE_BITS, typename Char , typename UInt >
Char * internal::format_uint (Char *buffer, UInt value, int num_digits, bool upper=false)
 
template<unsigned BASE_BITS, typename Char , typename It , typename UInt >
It internal::format_uint (It out, UInt value, int num_digits, bool upper=false)
 
template<typename Double >
FMT_API std::enable_if< sizeof(Double)==sizeof(uint64_t), bool >::type internal::grisu2_format (Double value, buffer &buf, core_format_specs)
 
template<typename Double >
std::enable_if< sizeof(Double)!=sizeof(uint64_t), bool >::type internal::grisu2_format (Double, buffer &, core_format_specs)
 
template<typename Double >
void internal::sprintf_format (Double value, internal::buffer &buf, core_format_specs spec)
 
template<typename Handler >
FMT_CONSTEXPR void internal::handle_int_type_spec (char spec, Handler &&handler)
 
template<typename Handler >
FMT_CONSTEXPR void internal::handle_float_type_spec (char spec, Handler &&handler)
 
template<typename Char , typename Handler >
FMT_CONSTEXPR void internal::handle_char_specs (const basic_format_specs< Char > *specs, Handler &&handler)
 
template<typename Char , typename Handler >
FMT_CONSTEXPR void internal::handle_cstring_type_spec (Char spec, Handler &&handler)
 
template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR void internal::check_string_type_spec (Char spec, ErrorHandler &&eh)
 
template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR void internal::check_pointer_type_spec (Char spec, ErrorHandler &&eh)
 
template<typename Char >
FMT_CONSTEXPR bool internal::is_name_start (Char c)
 
template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR unsigned internal::parse_nonnegative_int (const Char *&begin, const Char *end, ErrorHandler &&eh)
 
template<template< typename > class Handler, typename T , typename Context , typename ErrorHandler >
FMT_CONSTEXPR void internal::set_dynamic_spec (T &value, basic_format_arg< Context > arg, ErrorHandler eh)
 
template<typename Char , typename IDHandler >
FMT_CONSTEXPR const Char * internal::parse_arg_id (const Char *begin, const Char *end, IDHandler &&handler)
 
template<typename Char , typename Handler >
FMT_CONSTEXPR const Char * internal::parse_align (const Char *begin, const Char *end, Handler &&handler)
 
template<typename Char , typename Handler >
FMT_CONSTEXPR const Char * internal::parse_width (const Char *begin, const Char *end, Handler &&handler)
 
template<typename Char , typename SpecHandler >
FMT_CONSTEXPR const Char * internal::parse_format_specs (const Char *begin, const Char *end, SpecHandler &&handler)
 
template<bool IS_CONSTEXPR, typename T , typename Ptr = const T*>
FMT_CONSTEXPR bool internal::find (Ptr first, Ptr last, T value, Ptr &out)
 
template<>
bool internal::find< false, char > (const char *first, const char *last, char value, const char *&out)
 
template<bool IS_CONSTEXPR, typename Char , typename Handler >
FMT_CONSTEXPR void internal::parse_format_string (basic_string_view< Char > format_str, Handler &&handler)
 
template<typename T , typename ParseContext >
FMT_CONSTEXPR const ParseContext::char_type * internal::parse_format_specs (ParseContext &ctx)
 
template<typename Char , typename ErrorHandler , typename... Args>
FMT_CONSTEXPR bool internal::do_check_format_string (basic_string_view< Char > s, ErrorHandler eh=ErrorHandler())
 
template<typename... Args, typename S >
std::enable_if< is_compile_string< S >::value >::type internal::check_format_string (S)
 
template<template< typename > class Handler, typename Spec , typename Context >
void internal::handle_dynamic_spec (Spec &value, arg_ref< typename Context::char_type > ref, Context &ctx)
 
FMT_API void format_system_error (internal::buffer &out, int error_code, fmt::string_view message) FMT_NOEXCEPT
 
FMT_API void report_system_error (int error_code, string_view message) FMT_NOEXCEPT
 
template<typename T >
void format_decimal (char *&buffer, T value)
 
template<typename ArgFormatter , typename Char , typename Context >
Context::iterator vformat_to (typename ArgFormatter::range out, basic_string_view< Char > format_str, basic_format_args< Context > args, internal::locale_ref loc=internal::locale_ref())
 
template<typename T >
const void * ptr (const T *p)
 
template<typename It >
arg_join< It, char > join (It begin, It end, string_view sep)
 
template<typename It >
arg_join< It, wchar_t > join (It begin, It end, wstring_view sep)
 
template<typename T >
std::string to_string (const T &value)
 
template<typename T >
std::wstring to_wstring (const T &value)
 
template<typename Char , std::size_t SIZE>
std::basic_string< Char > to_string (const basic_memory_buffer< Char, SIZE > &buf)
 
template<typename S , typename Char = FMT_CHAR(S)>
buffer_context< Char >::type::iterator vformat_to (internal::basic_buffer< Char > &buf, const S &format_str, basic_format_args< typename buffer_context< Char >::type > args)
 
template<typename S , typename... Args, std::size_t SIZE = inline_buffer_size, typename Char = typename internal::char_t<S>::type>
buffer_context< Char >::type::iterator format_to (basic_memory_buffer< Char, SIZE > &buf, const S &format_str, const Args &...args)
 
template<typename String , typename OutputIt , typename... Args>
std::enable_if< internal::is_output_iterator< OutputIt >::value, OutputIt >::type vformat_to (OutputIt out, const String &format_str, typename format_args_t< OutputIt, FMT_CHAR(String)>::type args)
 
template<typename OutputIt , typename S , typename... Args>
 FMT_ENABLE_IF_T (internal::is_string< S >::value &&internal::is_output_iterator< OutputIt >::value, OutputIt) format_to(OutputIt out
 
return vformat_to (out, to_string_view(format_str), basic_format_args< context >(as))
 
template<typename OutputIt , typename Char , typename... Args>
format_arg_store< typename format_to_n_context< OutputIt, Char >::type, Args... > make_format_to_n_args (const Args &...args)
 
template<typename OutputIt , typename Char , typename... Args>
std::enable_if< internal::is_output_iterator< OutputIt >::value, format_to_n_result< OutputIt > >::type vformat_to_n (OutputIt out, std::size_t n, basic_string_view< Char > format_str, typename format_to_n_args< OutputIt, Char >::type args)
 
template<typename OutputIt , typename S , typename... Args>
 FMT_ENABLE_IF_T (internal::is_string< S >::value &&internal::is_output_iterator< OutputIt >::value, format_to_n_result< OutputIt >) format_to_n(OutputIt out
 
typedef FMT_CHAR (S) Char
 
format_arg_store< typename format_to_n_context< OutputIt, Char >::type, Args... > as (args...)
 
return vformat_to_n (out, n, to_string_view(format_str), typename format_to_n_args< OutputIt, Char >::type(as))
 
template<typename... Args>
std::size_t formatted_size (string_view format_str, const Args &...args)
 

Variables

const Sformat_str
 
const S const Args & args
 
format_arg_store< context, Args... > as {args...}
 
std::size_t n
 

Macro Definition Documentation

#define FMT_ALWAYS_INLINE

Definition at line 824 of file format.h.

#define FMT_CLANG_VERSION   0

Definition at line 43 of file format.h.

#define FMT_CUDA_VERSION   0

Definition at line 57 of file format.h.

#define FMT_FUNC

Definition at line 3547 of file format.h.

#define FMT_HAS_BUILTIN (   x)    0

Definition at line 91 of file format.h.

#define FMT_ICC_VERSION   0

Definition at line 51 of file format.h.

#define FMT_SECURE_SCL   0

Definition at line 81 of file format.h.

#define FMT_STRING (   s)
Value:
[] { \
typedef typename std::remove_cv<std::remove_pointer< \
struct str : fmt::compile_string { \
typedef ct char_type; \
FMT_CONSTEXPR operator fmt::basic_string_view<ct>() const { \
return {s, sizeof(s) / sizeof(ct) - 1}; \
} \
}; \
return str{}; \
}()
std::string str(const std::pair< Type, Type > &tt)
Definition: test_pimpos.cxx:12
static QCString type
Definition: declinfo.cpp:672
static QCString * s
Definition: config.cpp:1042

Definition at line 3513 of file format.h.

#define FMT_THROW (   x)    throw x

Definition at line 115 of file format.h.

#define FMT_UDL_TEMPLATE   0

Definition at line 144 of file format.h.

#define FMT_USE_EXTERN_TEMPLATES
Value:
((FMT_CLANG_VERSION >= 209 && __cplusplus >= 201103L) || \
#define FMT_CLANG_VERSION
Definition: format.h:43
#define FMT_GCC_VERSION
Definition: core.h:43
#define FMT_HAS_GXX_CXX11
Definition: core.h:49

Definition at line 149 of file format.h.

#define FMT_USE_GRISU   0

Definition at line 165 of file format.h.

#define FMT_USE_TRAILING_RETURN   0

Definition at line 161 of file format.h.

#define FMT_USE_USER_DEFINED_LITERALS   0

Definition at line 131 of file format.h.

#define FMT_USE_WINDOWS_H   0

Definition at line 1029 of file format.h.

Typedef Documentation

Definition at line 3344 of file format.h.

Definition at line 1115 of file format.h.

Definition at line 553 of file format.h.

Definition at line 554 of file format.h.

Definition at line 361 of file format.h.

Definition at line 362 of file format.h.

Enumeration Type Documentation

anonymous enum
Enumerator
inline_buffer_size 

Definition at line 431 of file format.h.

anonymous enum
Enumerator
SIGN_FLAG 
PLUS_FLAG 
MINUS_FLAG 
HASH_FLAG 

Definition at line 1084 of file format.h.

1084 { SIGN_FLAG = 1, PLUS_FLAG = 2, MINUS_FLAG = 4, HASH_FLAG = 8 };
enum alignment
Enumerator
ALIGN_DEFAULT 
ALIGN_LEFT 
ALIGN_RIGHT 
ALIGN_CENTER 
ALIGN_NUMERIC 

Definition at line 1079 of file format.h.

enum char8_t : unsigned char

Definition at line 407 of file format.h.

407 : unsigned char {};

Function Documentation

format_arg_store< typename format_to_n_context<OutputIt, Char>::type, Args...> as ( args...  )
typedef FMT_CHAR ( S  )
template<typename OutputIt , typename S , typename... Args>
FMT_ENABLE_IF_T ( internal::is_string< S >::value &&internal::is_output_iterator< OutputIt >::value  ,
OutputIt   
)
inline

Formats arguments, writes the result to the output iterator out and returns the iterator past the end of the output range.

Example**::

std::vector<char> out; fmt::format_to(std::back_inserter(out), "{}", 42);

template<typename OutputIt , typename S , typename... Args>
FMT_ENABLE_IF_T ( internal::is_string< S >::value &&internal::is_output_iterator< OutputIt >::value  ,
format_to_n_result< OutputIt >   
)
inline

Formats arguments, writes up to n characters of the result to the output iterator out and returns the total output size and the iterator past the end of the output range.

template<typename T >
void format_decimal ( char *&  buffer,
value 
)
inline

Definition at line 2894 of file format.h.

2894  {
2895  typedef typename internal::int_traits<T>::main_type main_type;
2896  main_type abs_value = static_cast<main_type>(value);
2898  *buffer++ = '-';
2899  abs_value = 0 - abs_value;
2900  }
2901  if (abs_value < 100) {
2902  if (abs_value < 10) {
2903  *buffer++ = static_cast<char>('0' + abs_value);
2904  return;
2905  }
2906  unsigned index = static_cast<unsigned>(abs_value * 2);
2908  *buffer++ = internal::data::DIGITS[index + 1];
2909  return;
2910  }
2911  int num_digits = internal::count_digits(abs_value);
2912  internal::format_decimal<char>(
2913  internal::make_checked(buffer, internal::to_unsigned(num_digits)), abs_value, num_digits);
2914  buffer += num_digits;
2915 }
static const char DIGITS[]
Definition: format.h:753
T * make_checked(T *p, std::size_t)
Definition: format.h:389
FMT_CONSTEXPR std::enable_if< std::numeric_limits< T >::is_signed, bool >::type is_negative(T value)
Definition: format.h:727
FMT_CONSTEXPR std::make_unsigned< Int >::type to_unsigned(Int value)
Definition: core.h:208
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
int count_digits(uint64_t n)
Definition: format.h:777
FMT_API void format_system_error ( internal::buffer out,
int  error_code,
fmt::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 906 of file format-inl.h.

907  {
908  FMT_TRY {
909  memory_buffer buf;
911  for (;;) {
912  char *system_message = &buf[0];
913  int result = safe_strerror(error_code, system_message, buf.size());
914  if (result == 0) {
915  writer w(out);
916  w.write(message);
917  w.write(": ");
918  w.write(system_message);
919  return;
920  }
921  if (result != ERANGE)
922  break; // Can't get error message, report error code instead.
923  buf.resize(buf.size() * 2);
924  }
925  } FMT_CATCH(...) {}
927 }
#define FMT_TRY
Definition: format-inl.h:40
static QCString result
void format_error_code(internal::buffer &out, int error_code, string_view message) FMT_NOEXCEPT
Definition: format-inl.h:159
void resize(std::size_t new_size)
Definition: core.h:264
std::size_t size() const FMT_NOEXCEPT
Definition: core.h:250
#define FMT_CATCH(x)
Definition: format-inl.h:41
int safe_strerror(int error_code, char *&buffer, std::size_t buffer_size) FMT_NOEXCEPT
Definition: format-inl.h:99
template<typename S , typename... Args, std::size_t SIZE = inline_buffer_size, typename Char = typename internal::char_t<S>::type>
buffer_context<Char>::type::iterator format_to ( basic_memory_buffer< Char, SIZE > &  buf,
const S format_str,
const Args &...  args 
)
inline

Definition at line 3252 of file format.h.

3254  {
3256  typedef typename buffer_context<Char>::type context;
3257  format_arg_store<context, Args...> as{args...};
3258  return internal::vformat_to(buf, to_string_view(format_str),
3260 }
const S & format_str
Definition: format.h:3342
format_arg_store< context, Args... > as
Definition: format.h:3345
std::enable_if<!is_compile_string< S >::value >::type check_format_string(const S &)
Definition: core.h:1352
buffer_context< Char >::type::iterator vformat_to(internal::basic_buffer< Char > &buf, basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
Definition: format.h:3233
format_context_t< OutputIt, FMT_CHAR(S)>::type context
Definition: format.h:3344
const S const Args & args
Definition: format.h:3342
string_view_t & to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
Definition: common.h:132
template<typename... Args>
std::size_t formatted_size ( string_view  format_str,
const Args &...  args 
)
inline

Returns the number of characters in the output of format(format_str, args...).

Definition at line 3423 of file format.h.

3424  {
3425  auto it = format_to(internal::counting_iterator<char>(), format_str, args...);
3426  return it.count();
3427 }
const S const Args & args
Definition: format.h:3342
buffer_context< Char >::type::iterator format_to(basic_memory_buffer< Char, SIZE > &buf, const S &format_str, const Args &...args)
Definition: format.h:3252
template<typename It >
arg_join<It, char> join ( It  begin,
It  end,
string_view  sep 
)

Definition at line 3172 of file format.h.

3172  {
3173  return arg_join<It, char>(begin, end, sep);
3174 }
FMT_CONSTEXPR T * end(T(&array)[N]) FMT_NOEXCEPT
Definition: format.h:259
FMT_CONSTEXPR T * begin(T(&array)[N]) FMT_NOEXCEPT
Definition: format.h:255
template<typename It >
arg_join<It, wchar_t> join ( It  begin,
It  end,
wstring_view  sep 
)

Definition at line 3177 of file format.h.

3177  {
3178  return arg_join<It, wchar_t>(begin, end, sep);
3179 }
FMT_CONSTEXPR T * end(T(&array)[N]) FMT_NOEXCEPT
Definition: format.h:259
FMT_CONSTEXPR T * begin(T(&array)[N]) FMT_NOEXCEPT
Definition: format.h:255
template<typename OutputIt , typename Char , typename... Args>
format_arg_store< typename format_to_n_context<OutputIt, Char>::type, Args...> make_format_to_n_args ( const Args &...  args)
inline

Definition at line 3371 of file format.h.

3371  {
3372  return format_arg_store<
3373  typename format_to_n_context<OutputIt, Char>::type, Args...>(args...);
3374 }
const S const Args & args
Definition: format.h:3342
template<typename T >
const void* ptr ( const T *  p)
inline

Definition at line 3138 of file format.h.

3138 { return p; }
p
Definition: test.py:223
FMT_API void report_system_error ( int  error_code,
string_view  message 
)

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

934  {
936 }
void report_error(FormatFunc func, int error_code, string_view message) FMT_NOEXCEPT
Definition: format-inl.h:186
FMT_FUNC void format_system_error(internal::buffer &out, int error_code, string_view message) FMT_NOEXCEPT
Definition: format-inl.h:906
template<typename T >
std::string to_string ( const T &  value)

Converts value to std::string using the default format for type T. It doesn't support user-defined types with custom formatters.

Example**::

#include <fmt/format.h>

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

Definition at line 3209 of file format.h.

3209  {
3210  std::string str;
3212  writer(buf).write(value);
3213  return str;
3214 }
std::string string
Definition: nybbler.cc:12
basic_writer< back_insert_range< internal::buffer > > writer
Definition: format.h:361
std::string str(const std::pair< Type, Type > &tt)
Definition: test_pimpos.cxx:12
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
template<typename Char , std::size_t SIZE>
std::basic_string<Char> to_string ( const basic_memory_buffer< Char, SIZE > &  buf)

Definition at line 3228 of file format.h.

3228  {
3229  return std::basic_string<Char>(buf.data(), buf.size());
3230 }
T * data() FMT_NOEXCEPT
Definition: core.h:256
std::size_t size() const FMT_NOEXCEPT
Definition: core.h:250
template<typename T >
std::wstring to_wstring ( const T &  value)

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

Definition at line 3220 of file format.h.

3220  {
3221  std::wstring str;
3223  wwriter(buf).write(value);
3224  return str;
3225 }
basic_writer< back_insert_range< internal::wbuffer > > wwriter
Definition: format.h:362
std::string str(const std::pair< Type, Type > &tt)
Definition: test_pimpos.cxx:12
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
template<typename ArgFormatter , typename Char , typename Context >
Context::iterator vformat_to ( typename ArgFormatter::range  out,
basic_string_view< Char >  format_str,
basic_format_args< Context >  args,
internal::locale_ref  loc = internal::locale_ref() 
)

Formats arguments and writes the output to the range.

Definition at line 3124 of file format.h.

3128  {
3129  format_handler<ArgFormatter, Char, Context> h(out, format_str, args, loc);
3130  internal::parse_format_string<false>(format_str, h);
3131  return h.context.out();
3132 }
const S & format_str
Definition: format.h:3342
h
training ###############################
Definition: train_cnn.py:186
template<typename S , typename Char = FMT_CHAR(S)>
buffer_context<Char>::type::iterator vformat_to ( internal::basic_buffer< Char > &  buf,
const S format_str,
basic_format_args< typename buffer_context< Char >::type args 
)
inline

Definition at line 3242 of file format.h.

3244  {
3245  return internal::vformat_to(buf, to_string_view(format_str), args);
3246 }
buffer_context< Char >::type::iterator vformat_to(internal::basic_buffer< Char > &buf, basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
Definition: format.h:3233
string_view_t & to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
Definition: common.h:132
template<typename String , typename OutputIt , typename... Args>
std::enable_if<internal::is_output_iterator<OutputIt>::value, OutputIt>::type vformat_to ( OutputIt  out,
const String format_str,
typename format_args_t< OutputIt, FMT_CHAR(String)>::type  args 
)
inline

Definition at line 3320 of file format.h.

3321  {
3323  return vformat_to<arg_formatter<range>>(range(out),
3324  to_string_view(format_str), args);
3325 }
const S const Args & args
Definition: format.h:3342
string_view_t & to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
Definition: common.h:132
return vformat_to ( out  ,
to_string_view(format_str ,
basic_format_args< context as 
)
template<typename OutputIt , typename Char , typename... Args>
std::enable_if< internal::is_output_iterator<OutputIt>::value, format_to_n_result<OutputIt> >::type vformat_to_n ( OutputIt  out,
std::size_t  n,
basic_string_view< Char >  format_str,
typename format_to_n_args< OutputIt, Char >::type  args 
)
inline

Definition at line 3379 of file format.h.

3381  {
3383  auto it = vformat_to(It(out, n), format_str, args);
3384  return {it.base(), it.count()};
3385 }
const S const Args & args
Definition: format.h:3342
Context::iterator vformat_to(typename ArgFormatter::range out, basic_string_view< Char > format_str, basic_format_args< Context > args, internal::locale_ref loc=internal::locale_ref())
Definition: format.h:3124
std::size_t n
Definition: format.h:3399
return vformat_to_n ( out  ,
n  ,
to_string_view(format_str ,
typename format_to_n_args< OutputIt, Char >  ::typeas 
)

Variable Documentation

std::size_t const S const Args& args
Initial value:
{
const S & format_str
Definition: format.h:3342
std::enable_if<!is_compile_string< S >::value >::type check_format_string(const S &)
Definition: core.h:1352

Definition at line 3342 of file format.h.

format_arg_store< context, Args... > as {args...}

Definition at line 3345 of file format.h.

std::size_t const S & format_str

Definition at line 3342 of file format.h.

std::size_t n

Definition at line 3399 of file format.h.