Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
core.h File Reference
#include <cstdio>
#include <cstring>
#include <functional>
#include <iterator>
#include <memory>
#include <string>
#include <type_traits>
#include <vector>
Include dependency graph for core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  detail::arg_data< T, Char, NUM_ARGS, NUM_NAMED_ARGS >
 
struct  detail::arg_data< T, Char, NUM_ARGS, 0 >
 
struct  detail::arg_mapper< Context >
 
class  basic_format_arg< Context >
 
class  basic_format_arg< Context >
 
class  basic_format_args< Context >
 
class  basic_format_args< Context >
 
class  basic_format_context< OutputIt, Char >
 
class  basic_format_parse_context< Char, ErrorHandler >
 
class  basic_string_view< Char >
 
class  detail::buffer< T >
 
class  detail::buffer_appender< T >
 
struct  detail::buffer_traits
 
struct  detail::char_t_impl< S, typename >
 
struct  detail::char_t_impl< S, enable_if_t< is_string< S >::value > >
 
struct  compile_string
 
class  detail::counting_buffer< T >
 
struct  detail::custom_value< Context >
 
class  detail::dynamic_arg_list
 
class  dynamic_format_arg_store< Context >
 
class  dynamic_format_arg_store< Context >
 
struct  detail::error_handler
 
struct  detail::fallback_formatter< T, Char, Enable >
 
class  detail::fixed_buffer_traits
 
class  format_arg_store< Context, Args >
 
struct  format_args
 
struct  format_to_n_result< OutputIt >
 
struct  formattable< T >
 
struct  formatter< T, Char, Enable >
 
class  basic_format_arg< Context >::handle
 
struct  detail::int128_t
 
struct  detail::is_back_insert_iterator< OutputIt >
 
struct  detail::is_back_insert_iterator< std::back_insert_iterator< Container > >
 
struct  is_char< T >
 
struct  is_char< char >
 
struct  is_char< char16_t >
 
struct  is_char< char32_t >
 
struct  is_char< detail::char8_type >
 
struct  is_char< wchar_t >
 
struct  is_compile_string< S >
 
struct  is_contiguous< T >
 
struct  is_contiguous< std::basic_string< Char > >
 
struct  detail::is_contiguous_back_insert_iterator< OutputIt >
 
struct  detail::is_contiguous_back_insert_iterator< buffer_appender< Char > >
 
struct  detail::is_contiguous_back_insert_iterator< std::back_insert_iterator< Container > >
 
struct  detail::is_named_arg< T >
 
struct  detail::is_named_arg< named_arg< Char, T > >
 
class  detail::is_output_iterator< It >
 
struct  detail::is_reference_wrapper< T >
 
struct  detail::is_reference_wrapper< std::reference_wrapper< T > >
 
struct  detail::is_string< S >
 
class  detail::iterator_buffer< OutputIt, T, Traits >
 
class  detail::iterator_buffer< std::back_insert_iterator< Container >, enable_if_t< is_contiguous< Container >::value, typename Container::value_type > >
 
class  detail::iterator_buffer< T *, T >
 
struct  detail::iterator_category< It, Enable >
 
struct  detail::iterator_category< It, void_t< typename It::iterator_category > >
 
struct  detail::iterator_category< T * >
 
class  detail::locale_ref
 
struct  monostate
 
struct  detail::named_arg< Char, T >
 
struct  detail::named_arg_info< Char >
 
struct  detail::named_arg_value< Char >
 
struct  dynamic_format_arg_store< Context >::need_copy< T >
 
struct  detail::dynamic_arg_list::node< typename >
 
struct  detail::std_string_view< T >
 
struct  detail::string_value< Char >
 
struct  detail::type_constant< T, Char >
 
struct  type_identity< T >
 
struct  detail::dynamic_arg_list::typed_node< T >
 
struct  detail::uint128_t
 
struct  detail::unformattable
 
class  detail::value< Context >
 
struct  detail::view
 
struct  detail::void_t_impl< Ts >
 
struct  wformat_args
 

Namespaces

 detail
 

Macros

#define FMT_API
 
#define FMT_ASSERT(condition, message)
 
#define FMT_BEGIN_NAMESPACE
 
#define FMT_BUFFER_CONTEXT(Char)   basic_format_context<detail::buffer_appender<Char>, Char>
 
#define FMT_CLANG_VERSION   0
 
#define FMT_CLASS_API
 
#define FMT_CONSTEXPR   inline
 
#define FMT_CONSTEXPR_DECL
 
#define FMT_DEPRECATED   /* deprecated */
 
using FMT_DEPRECATED_ALIAS   FMT_DEPRECATED
 
#define FMT_DETECTED_NOEXCEPT   throw()
 
#define FMT_ENABLE_IF(...)   enable_if_t<(__VA_ARGS__), int> = 0
 
#define FMT_END_NAMESPACE
 
#define FMT_EXCEPTIONS   1
 
#define FMT_EXTERN   extern
 
#define FMT_EXTERN_TEMPLATE_API
 
#define FMT_GCC_VERSION   0
 
#define FMT_HAS_CPP14_ATTRIBUTE(attribute)   (__cplusplus >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute))
 
#define FMT_HAS_CPP17_ATTRIBUTE(attribute)   (__cplusplus >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute))
 
#define FMT_HAS_CPP_ATTRIBUTE(x)   0
 
#define FMT_HAS_CXX11_NOEXCEPT   0
 
#define FMT_HAS_FEATURE(x)   0
 
#define FMT_HAS_GXX_CXX11   0
 
#define FMT_HAS_INCLUDE(x)   0
 
#define FMT_ICC_VERSION   0
 
#define FMT_INLINE   inline
 
#define FMT_INLINE_NAMESPACE   namespace
 
#define FMT_INSTANTIATION_DEF_API   FMT_API
 
#define FMT_MSC_VER   0
 
#define FMT_NOEXCEPT   FMT_DETECTED_NOEXCEPT
 
#define FMT_NORETURN
 
#define FMT_NVCC   0
 
#define FMT_OVERRIDE
 
#define FMT_SUPPRESS_MSC_WARNING(n)
 
#define FMT_TYPE_CONSTANT(Type, constant)
 
#define FMT_UNICODE   !FMT_MSC_VER
 
#define FMT_USE_CONSTEXPR
 
#define FMT_USE_INT128   0
 
#define FMT_USE_NOEXCEPT   0
 
#define FMT_VERSION   70003
 

Typedefs

template<bool B>
using bool_constant = std::integral_constant< bool, B >
 
template<typename Char >
using buffer_context = basic_format_context< detail::buffer_appender< Char >, Char >
 
template<typename S >
using char_t = typename detail::char_t_impl< S >::type
 
template<bool B, class T , class F >
using conditional_t = typename std::conditional< B, T, F >::type
 
template<bool B, class T = void>
using enable_if_t = typename std::enable_if< B, T >::type
 
using format_context = buffer_context< char >
 
using format_parse_context = basic_format_parse_context< char >
 
template<typename T , typename Context >
using detail::has_fallback_formatter = std::is_constructible< fallback_formatter< T, typename Context::char_type >>
 
template<typename T , typename Context >
using has_formatter = std::is_constructible< typename Context::template formatter_type< T >>
 
using detail::long_type = conditional_t< long_short, int, long long >
 
template<typename T , typename Context >
using detail::mapped_type_constant = type_constant< decltype(arg_mapper< Context >().map(std::declval< const T & >())), typename Context::char_type >
 
template<typename T >
using remove_const_t = typename std::remove_const< T >::type
 
template<typename T >
using remove_cvref_t = typename std::remove_cv< remove_reference_t< T >>::type
 
template<typename T >
using remove_reference_t = typename std::remove_reference< T >::type
 
using string_view = basic_string_view< char >
 
template<typename T >
using type_identity_t = typename type_identity< T >::type
 
using detail::ulong_type = conditional_t< long_short, unsigned, unsigned long long >
 
template<typename... Ts>
using detail::void_t = typename detail::void_t_impl< Ts... >::type
 
using wformat_context = buffer_context< wchar_t >
 
using wformat_parse_context = basic_format_parse_context< wchar_t >
 
using wstring_view = basic_string_view< wchar_t >
 

Enumerations

enum  { detail::long_short = sizeof(long) == sizeof(int) }
 
enum  { detail::packed_arg_bits = 4 }
 
enum  { detail::max_packed_args = 62 / packed_arg_bits }
 
enum  : unsigned long long { detail::is_unpacked_bit = 1ULL << 63 }
 
enum  : unsigned long long { detail::has_named_args_bit = 1ULL << 62 }
 
enum  detail::char8_type : unsigned char
 
enum  detail::type {
  detail::type::none_type, detail::type::int_type, detail::type::uint_type, detail::type::long_long_type,
  detail::type::ulong_long_type, detail::type::int128_type, detail::type::uint128_type, detail::type::bool_type,
  detail::type::char_type, detail::type::last_integer_type = char_type, detail::type::float_type, detail::type::double_type,
  detail::type::long_double_type, detail::type::last_numeric_type = long_double_type, detail::type::cstring_type, detail::type::string_type,
  detail::type::pointer_type, detail::type::custom_type
}
 

Functions

template<typename Char , typename T >
detail::named_arg< Char, T > arg (const Char *name, const T &arg)
 
FMT_NORETURN FMT_API void detail::assert_fail (const char *file, int line, const char *message)
 
template<typename T >
int detail::check (unformattable)
 
template<typename T , typename U >
const U & detail::check (const U &val)
 
template<typename... , typename S , FMT_ENABLE_IF(!is_compile_string< S >::value) >
FMT_INLINE void detail::check_format_string (const S &)
 
template<typename... , typename S , FMT_ENABLE_IF(is_compile_string< S >::value) >
void detail::check_format_string (S)
 
template<typename T >
constexpr T detail::const_check (T value)
 
template<bool B = false>
constexpr size_t detail::count ()
 
template<bool B1, bool B2, bool... Tail>
constexpr size_t detail::count ()
 
template<typename... Args>
constexpr size_t detail::count_named_args ()
 
template<typename >
constexpr unsigned long long detail::encode_types ()
 
template<typename Context , typename Arg , typename... Args>
constexpr unsigned long long detail::encode_types ()
 
 detail::FMT_SUPPRESS_MSC_WARNING (4566) const expr unsigned char micro[]
 
 detail::FMT_TYPE_CONSTANT (int, int_type)
 
 detail::FMT_TYPE_CONSTANT (unsigned, uint_type)
 
 detail::FMT_TYPE_CONSTANT (long long, long_long_type)
 
 detail::FMT_TYPE_CONSTANT (unsigned long long, ulong_long_type)
 
 detail::FMT_TYPE_CONSTANT (int128_t, int128_type)
 
 detail::FMT_TYPE_CONSTANT (uint128_t, uint128_type)
 
 detail::FMT_TYPE_CONSTANT (bool, bool_type)
 
 detail::FMT_TYPE_CONSTANT (Char, char_type)
 
 detail::FMT_TYPE_CONSTANT (float, float_type)
 
 detail::FMT_TYPE_CONSTANT (double, double_type)
 
 detail::FMT_TYPE_CONSTANT (long double, long_double_type)
 
 detail::FMT_TYPE_CONSTANT (const Char *, cstring_type)
 
 detail::FMT_TYPE_CONSTANT (basic_string_view< Char >, string_type)
 
 detail::FMT_TYPE_CONSTANT (const void *, pointer_type)
 
template<typename S , typename... Args, typename Char = char_t<S>>
FMT_INLINE std::basic_string< Char > format (const S &format_str, Args &&...args)
 
template<typename OutputIt , typename S , typename... Args, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt >::value &&detail::is_string< S >::value) >
OutputIt format_to (OutputIt out, const S &format_str, Args &&...args)
 
template<typename OutputIt , typename S , typename... Args, FMT_ENABLE_IF(detail::is_string< S >::value &&detail::is_output_iterator< OutputIt >::value) >
format_to_n_result< OutputIt > format_to_n (OutputIt out, size_t n, const S &format_str, const Args &...args)
 
template<typename... Args>
size_t formatted_size (string_view format_str, Args &&...args)
 
template<typename T , typename OutputIt >
iterator_buffer< OutputIt, T > detail::get_buffer (OutputIt)
 
template<typename T >
buffer< T > & detail::get_buffer (buffer_appender< T >)
 
template<typename OutputIt >
OutputIt detail::get_buffer_init (OutputIt out)
 
template<typename T >
buffer< T > & detail::get_buffer_init (buffer_appender< T > out)
 
template<typename Container >
Container & detail::get_container (std::back_insert_iterator< Container > it)
 
template<typename Buffer >
auto detail::get_iterator (Buffer &buf) -> decltype(buf.out())
 
template<typename T >
buffer_appender< T > detail::get_iterator (buffer< T > &buf)
 
template<typename Char >
void detail::init_named_args (named_arg_info< Char > *, int, int)
 
template<typename Char , typename T , typename... Tail>
void detail::init_named_args (named_arg_info< Char > *named_args, int arg_count, int named_arg_count, const T &, const Tail &...args)
 
template<typename Char , typename T , typename... Tail>
void detail::init_named_args (named_arg_info< Char > *named_args, int arg_count, int named_arg_count, const named_arg< Char, T > &arg, const Tail &...args)
 
template<typename... Args>
FMT_INLINE void detail::init_named_args (std::nullptr_t, int, int, const Args &...)
 
constexpr bool detail::is_arithmetic_type (type t)
 
constexpr bool detail::is_integral_type (type t)
 
template<typename Char >
constexpr bool detail::is_unicode ()
 
template<typename Context , typename T >
FMT_CONSTEXPR basic_format_arg< Context > detail::make_arg (const T &value)
 
template<bool IS_PACKED, typename Context , type , typename T , FMT_ENABLE_IF(IS_PACKED) >
value< Context > detail::make_arg (const T &val)
 
template<bool IS_PACKED, typename Context , type , typename T , FMT_ENABLE_IF(!IS_PACKED) >
basic_format_arg< Context > detail::make_arg (const T &value)
 
template<typename... Args, typename S , typename Char = char_t<S>>
auto make_args_checked (const S &format_str, const remove_reference_t< Args > &...args) -> format_arg_store< buffer_context< Char >, remove_reference_t< Args >... >
 
template<typename Context = format_context, typename... Args>
format_arg_store< Context, Args... > make_format_args (const Args &...args)
 
template<typename S , typename... Args, typename Char = char_t<S>>
void print (std::FILE *f, const S &format_str, Args &&...args)
 
template<typename S , typename... Args, typename Char = char_t<S>>
void print (const S &format_str, Args &&...args)
 
template<typename Char , FMT_ENABLE_IF(is_char< Char >::value) >
basic_string_view< Char > to_string_view (const Char *s)
 
template<typename Char , typename Traits , typename Alloc >
basic_string_view< Char > to_string_view (const std::basic_string< Char, Traits, Alloc > &s)
 
template<typename Char >
basic_string_view< Char > to_string_view (basic_string_view< Char > s)
 
template<typename Char , FMT_ENABLE_IF(!std::is_empty< detail::std_string_view< Char >>::value) >
basic_string_view< Char > to_string_view (detail::std_string_view< Char > s)
 
template<typename S , FMT_ENABLE_IF(is_compile_string< S >::value) >
constexpr basic_string_view< typename S::char_type > to_string_view (const S &s)
 
void detail::to_string_view (...)
 
template<typename Int >
FMT_CONSTEXPR std::make_unsigned< Int >::type detail::to_unsigned (Int value)
 
template<typename T >
const T & detail::unwrap (const T &v)
 
template<typename T >
const T & detail::unwrap (const std::reference_wrapper< T > &v)
 
template<typename Char , FMT_ENABLE_IF(!std::is_same< Char, char >::value) >
std::basic_string< Char > detail::vformat (basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
 
FMT_API std::string detail::vformat (string_view format_str, format_args args)
 
template<typename S , typename Char = char_t<S>>
FMT_INLINE std::basic_string< Char > vformat (const S &format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
 
template<typename Char >
buffer_appender< Char > detail::vformat_to (buffer< Char > &buf, basic_string_view< Char > format_str, basic_format_args< FMT_BUFFER_CONTEXT(type_identity_t< Char >)> args)
 
template<typename OutputIt , typename S , typename Char = char_t<S>, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt >::value) >
OutputIt vformat_to (OutputIt out, const S &format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
 
template<typename OutputIt , typename Char , typename... Args, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt >::value) >
format_to_n_result< OutputIt > vformat_to_n (OutputIt out, size_t n, basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
 
template<typename Visitor , typename Context >
FMT_CONSTEXPR_DECL FMT_INLINE auto visit_format_arg (Visitor &&vis, const basic_format_arg< Context > &arg) -> decltype(vis(0))
 
FMT_API void vprint (string_view, format_args)
 
FMT_API void vprint (std::FILE *, string_view, format_args)
 
template<typename Char , typename Args , FMT_ENABLE_IF(!std::is_same< Char, char >::value) >
void detail::vprint_mojibake (std::FILE *, basic_string_view< Char >, const Args &)
 
FMT_API void detail::vprint_mojibake (std::FILE *, string_view, format_args)
 

Macro Definition Documentation

#define FMT_API

Definition at line 214 of file core.h.

#define FMT_ASSERT (   condition,
  message 
)
Value:
((condition) /* void() fails with -Winvalid-constexpr on clang 4.0.1 */ \
? (void)0 \
: ::fmt::detail::assert_fail(__FILE__, __LINE__, (message)))
FMT_NORETURN FMT_API void assert_fail(const char *file, int line, const char *message)
Definition: format-inl.h:38

Definition at line 284 of file core.h.

#define FMT_BEGIN_NAMESPACE
Value:
namespace fmt { \
#define FMT_INLINE_NAMESPACE
Definition: core.h:189

Definition at line 195 of file core.h.

#define FMT_BUFFER_CONTEXT (   Char)    basic_format_context<detail::buffer_appender<Char>, Char>

Definition at line 1559 of file core.h.

#define FMT_CLANG_VERSION   0

Definition at line 26 of file core.h.

#define FMT_CLASS_API

Definition at line 211 of file core.h.

#define FMT_CONSTEXPR   inline

Definition at line 98 of file core.h.

#define FMT_CONSTEXPR_DECL

Definition at line 99 of file core.h.

#define FMT_DEPRECATED   /* deprecated */

Definition at line 161 of file core.h.

Definition at line 170 of file core.h.

#define FMT_DETECTED_NOEXCEPT   throw()

Definition at line 131 of file core.h.

#define FMT_ENABLE_IF (   ...)    enable_if_t<(__VA_ARGS__), int> = 0

Definition at line 269 of file core.h.

#define FMT_END_NAMESPACE
Value:
} \
using namespace v7; \
}

Definition at line 190 of file core.h.

#define FMT_EXCEPTIONS   1

Definition at line 117 of file core.h.

#define FMT_EXTERN   extern

Definition at line 224 of file core.h.

#define FMT_EXTERN_TEMPLATE_API

Definition at line 217 of file core.h.

#define FMT_GCC_VERSION   0

Definition at line 32 of file core.h.

#define FMT_HAS_CPP14_ATTRIBUTE (   attribute)    (__cplusplus >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute))

Definition at line 80 of file core.h.

#define FMT_HAS_CPP17_ATTRIBUTE (   attribute)    (__cplusplus >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute))

Definition at line 83 of file core.h.

#define FMT_HAS_CPP_ATTRIBUTE (   x)    0

Definition at line 77 of file core.h.

#define FMT_HAS_CXX11_NOEXCEPT   0

Definition at line 132 of file core.h.

#define FMT_HAS_FEATURE (   x)    0

Definition at line 64 of file core.h.

#define FMT_HAS_GXX_CXX11   0

Definition at line 44 of file core.h.

#define FMT_HAS_INCLUDE (   x)    0

Definition at line 71 of file core.h.

#define FMT_ICC_VERSION   0

Definition at line 38 of file core.h.

#define FMT_INLINE   inline

Definition at line 177 of file core.h.

#define FMT_INLINE_NAMESPACE   namespace

Definition at line 189 of file core.h.

#define FMT_INSTANTIATION_DEF_API   FMT_API

Definition at line 220 of file core.h.

#define FMT_MSC_VER   0

Definition at line 57 of file core.h.

#define FMT_NOEXCEPT   FMT_DETECTED_NOEXCEPT

Definition at line 137 of file core.h.

#define FMT_NORETURN

Definition at line 149 of file core.h.

#define FMT_NVCC   0

Definition at line 50 of file core.h.

#define FMT_OVERRIDE

Definition at line 107 of file core.h.

#define FMT_SUPPRESS_MSC_WARNING (   n)

Definition at line 58 of file core.h.

#define FMT_TYPE_CONSTANT (   Type,
  constant 
)
Value:
template <typename Char> \
struct type_constant<Type, Char> \
: std::integral_constant<type, type::constant> {}

Definition at line 996 of file core.h.

#define FMT_UNICODE   !FMT_MSC_VER

Definition at line 241 of file core.h.

#define FMT_USE_CONSTEXPR
Value:
(FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \
(FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L)) && \
#define FMT_MSC_VER
Definition: core.h:57
#define FMT_NVCC
Definition: core.h:50
#define FMT_ICC_VERSION
Definition: core.h:38
#define FMT_GCC_VERSION
Definition: core.h:32
#define FMT_HAS_FEATURE(x)
Definition: core.h:64

Definition at line 89 of file core.h.

#define FMT_USE_INT128   0

Definition at line 308 of file core.h.

#define FMT_USE_NOEXCEPT   0

Definition at line 123 of file core.h.

#define FMT_VERSION   70003

Definition at line 21 of file core.h.

Typedef Documentation

template<bool B>
using bool_constant = std::integral_constant<bool, B>

Definition at line 254 of file core.h.

template<typename Char >
using buffer_context = basic_format_context<detail::buffer_appender<Char>, Char>

Definition at line 1554 of file core.h.

template<typename S >
using char_t = typename detail::char_t_impl<S>::type

String's character type.

Definition at line 532 of file core.h.

template<bool B, class T , class F >
using conditional_t = typename std::conditional<B, T, F>::type

Definition at line 253 of file core.h.

template<bool B, class T = void>
using enable_if_t = typename std::enable_if<B, T>::type

Definition at line 251 of file core.h.

Definition at line 1555 of file core.h.

Definition at line 613 of file core.h.

template<typename T , typename Context >
using has_formatter = std::is_constructible<typename Context::template formatter_type<T>>

Definition at line 631 of file core.h.

template<typename T >
using remove_const_t = typename std::remove_const<T>::type

Definition at line 258 of file core.h.

template<typename T >
using remove_cvref_t = typename std::remove_cv<remove_reference_t<T>>::type

Definition at line 260 of file core.h.

template<typename T >
using remove_reference_t = typename std::remove_reference<T>::type

Definition at line 256 of file core.h.

Definition at line 432 of file core.h.

template<typename T >
using type_identity_t = typename type_identity<T>::type

Definition at line 262 of file core.h.

using wformat_context = buffer_context<wchar_t>

Definition at line 1556 of file core.h.

Definition at line 614 of file core.h.

using wstring_view = basic_string_view<wchar_t>

Definition at line 433 of file core.h.

Function Documentation

template<typename Char , typename T >
detail::named_arg<Char, T> arg ( const Char *  name,
const T &  arg 
)
inline

Returns a named argument to be used in a formatting function. It should only be used in a call to a formatting function.

Example**::

fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23));

Definition at line 1656 of file core.h.

template<typename S , typename... Args, typename Char = char_t<S>>
FMT_INLINE std::basic_string<Char> format ( const S &  format_str,
Args &&...  args 
)

Formats arguments and returns the result as a string.

Example**::

#include <fmt/core.h> std::string message = fmt::format("The answer is {}", 42);

Definition at line 2081 of file core.h.

template<typename OutputIt , typename S , typename... Args, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt >::value &&detail::is_string< S >::value) >
OutputIt format_to ( OutputIt  out,
const S &  format_str,
Args &&...  args 
)
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);

Definition at line 2009 of file core.h.

template<typename OutputIt , typename S , typename... Args, FMT_ENABLE_IF(detail::is_string< S >::value &&detail::is_output_iterator< OutputIt >::value) >
format_to_n_result<OutputIt> format_to_n ( OutputIt  out,
size_t  n,
const S &  format_str,
const Args &...  args 
)
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.

Definition at line 2042 of file core.h.

template<typename... Args>
size_t formatted_size ( string_view  format_str,
Args &&...  args 
)
inline

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

Definition at line 2054 of file core.h.

template<typename... Args, typename S , typename Char = char_t<S>>
auto make_args_checked ( const S &  format_str,
const remove_reference_t< Args > &...  args 
) -> format_arg_store<buffer_context<Char>, remove_reference_t<Args>...>
inline

Constructs a ~fmtformat_arg_store object that contains references to arguments and can be implicitly converted to ~fmtformat_args. If format_str is a compile-time string then make_args_checked checks its validity at compile time.

Definition at line 1633 of file core.h.

template<typename Context = format_context, typename... Args>
format_arg_store<Context, Args...> make_format_args ( const Args &...  args)
inline

Constructs a ~fmtformat_arg_store object that contains references to arguments and can be implicitly converted to ~fmtformat_args. Context can be omitted in which case it defaults to ~fmt::context. See ~fmtarg for lifetime considerations.

Definition at line 1619 of file core.h.

template<typename S , typename... Args, typename Char = char_t<S>>
void print ( std::FILE *  f,
const S &  format_str,
Args &&...  args 
)
inline

Formats args according to specifications in format_str and writes the output to the file f. Strings are assumed to be Unicode-encoded unless the FMT_UNICODE macro is set to 0.

Example**::

fmt::print(stderr, "Don't {}!", "panic");

Definition at line 2101 of file core.h.

template<typename S , typename... Args, typename Char = char_t<S>>
void print ( const S &  format_str,
Args &&...  args 
)
inline

Formats args according to specifications in format_str and writes the output to stdout. Strings are assumed to be Unicode-encoded unless the FMT_UNICODE macro is set to 0.

Example**::

fmt::print("Elapsed time: {0:.2f} seconds", 1.23);

Definition at line 2120 of file core.h.

template<typename Char , FMT_ENABLE_IF(is_char< Char >::value) >
basic_string_view<Char> to_string_view ( const Char *  s)
inline

Returns a string view of s. In order to add custom string type support to {fmt} provide an overload of to_string_view for it in the same namespace as the type for the argument-dependent lookup to work.

Example**::

namespace my_ns { inline string_view to_string_view(const my_string& s) { return {s.data(), s.length()}; } } std::string message = fmt::format(my_string("The answer is {}"), 42);

Definition at line 460 of file core.h.

template<typename Char , typename Traits , typename Alloc >
basic_string_view<Char> to_string_view ( const std::basic_string< Char, Traits, Alloc > &  s)
inline

Definition at line 465 of file core.h.

template<typename Char >
basic_string_view<Char> to_string_view ( basic_string_view< Char >  s)
inline

Definition at line 471 of file core.h.

template<typename Char , FMT_ENABLE_IF(!std::is_empty< detail::std_string_view< Char >>::value) >
basic_string_view<Char> to_string_view ( detail::std_string_view< Char >  s)
inline

Definition at line 477 of file core.h.

template<typename S , FMT_ENABLE_IF(is_compile_string< S >::value) >
constexpr basic_string_view<typename S::char_type> to_string_view ( const S &  s)

Definition at line 489 of file core.h.

template<typename S , typename Char = char_t<S>>
FMT_INLINE std::basic_string<Char> vformat ( const S &  format_str,
basic_format_args< buffer_context< type_identity_t< Char >>>  args 
)

Definition at line 2062 of file core.h.

template<typename OutputIt , typename S , typename Char = char_t<S>, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt >::value) >
OutputIt vformat_to ( OutputIt  out,
const S &  format_str,
basic_format_args< buffer_context< type_identity_t< Char >>>  args 
)

Formats a string and writes the output to out.

Definition at line 1987 of file core.h.

template<typename OutputIt , typename Char , typename... Args, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt >::value) >
format_to_n_result<OutputIt> vformat_to_n ( OutputIt  out,
size_t  n,
basic_string_view< Char >  format_str,
basic_format_args< buffer_context< type_identity_t< Char >>>  args 
)
inline

Definition at line 2023 of file core.h.

template<typename Visitor , typename Context >
FMT_CONSTEXPR_DECL FMT_INLINE auto visit_format_arg ( Visitor &&  vis,
const basic_format_arg< Context > &  arg 
) -> decltype(vis(0))

Visits an argument dispatching to the appropriate visit method based on the argument type. For example, if the argument type is double then vis(value) will be called with the value of type double.

Definition at line 1302 of file core.h.

FMT_API void vprint ( string_view  ,
format_args   
)

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

FMT_API void vprint ( std::FILE *  ,
string_view  ,
format_args   
)

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



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