HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
core.h File Reference
#include <cstdio>
#include <cstring>
#include <iterator>
#include <limits>
#include <string>
#include <type_traits>
+ 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  type_identity< T >
 
struct  monostate
 
struct  std_string_view< T >
 
class  basic_string_view< Char >
 
struct  is_char< T >
 
struct  is_char< char >
 
struct  compile_string
 
struct  is_compile_string< S >
 
struct  is_string< S >
 
struct  char_t_impl< S, typename >
 
struct  char_t_impl< S, enable_if_t< is_string< S >::value > >
 
struct  error_handler
 
class  basic_format_parse_context< Char, ErrorHandler >
 
class  basic_format_arg< Context >
 
class  basic_format_args< Context >
 
class  dynamic_format_arg_store< Context >
 
struct  formatter< T, Char, Enable >
 
struct  is_contiguous< T >
 
struct  is_contiguous< std::basic_string< Char > >
 
class  buffer< T >
 
struct  buffer_traits
 
class  fixed_buffer_traits
 
class  iterator_buffer< OutputIt, T, Traits >
 
class  iterator_buffer< T *, T >
 
class  iterator_buffer< std::back_insert_iterator< Container >, enable_if_t< is_contiguous< Container >::value, typename Container::value_type > >
 
class  counting_buffer< T >
 
struct  fallback_formatter< T, Char, Enable >
 
struct  view
 
struct  named_arg< Char, T >
 
struct  named_arg_info< Char >
 
struct  arg_data< T, Char, NUM_ARGS, NUM_NAMED_ARGS >
 
struct  arg_data< T, Char, NUM_ARGS, 0 >
 
struct  is_named_arg< T >
 
struct  is_statically_named_arg< T >
 
struct  is_named_arg< named_arg< Char, T > >
 
struct  type_constant< T, Char >
 
struct  string_value< Char >
 
struct  named_arg_value< Char >
 
struct  custom_value< Context >
 
class  value< Context >
 
struct  unformattable
 
struct  arg_mapper< Context >
 
class  appender
 
class  basic_format_arg< Context >
 
class  basic_format_arg< Context >::handle
 
struct  is_output_iterator< It, T, Enable >
 
struct  is_output_iterator< It, T, void_t< typename std::iterator_traits< It >::iterator_category, decltype(*std::declval< It >()=std::declval< T >())> >
 
struct  is_back_insert_iterator< OutputIt >
 
struct  is_back_insert_iterator< std::back_insert_iterator< Container > >
 
struct  is_contiguous_back_insert_iterator< OutputIt >
 
struct  is_contiguous_back_insert_iterator< std::back_insert_iterator< Container > >
 
struct  is_contiguous_back_insert_iterator< appender >
 
class  locale_ref
 
class  basic_format_context< OutputIt, Char >
 
class  format_arg_store< Context, Args >
 
class  basic_format_args< Context >
 
struct  fill_t< Char >
 
struct  basic_format_specs< Char >
 
struct  arg_ref< Char >
 
union  arg_ref< Char >::value
 
struct  dynamic_format_specs< Char >
 
struct  auto_id
 
class  specs_setter< Char >
 
class  dynamic_specs_handler< ParseContext >
 
class  compile_parse_context< Char, ErrorHandler >
 
struct  float_specs
 
class  specs_checker< Handler >
 
class  format_string_checker< Char, ErrorHandler, Args >
 
struct  formatter< T, Char, enable_if_t< detail::type_constant< T, Char >::value!=detail::type::custom_type > >
 
struct  basic_runtime< Char >
 
class  basic_format_string< Char, Args >
 
struct  format_to_n_result< OutputIt >
 

Namespaces

 align
 
 sign
 

Macros

#define FMT_VERSION   80000
 
#define FMT_CLANG_VERSION   0
 
#define FMT_GCC_VERSION   0
 
#define FMT_GCC_PRAGMA(arg)
 
#define FMT_HAS_GXX_CXX11   0
 
#define FMT_ICC_VERSION   0
 
#define FMT_NVCC   0
 
#define FMT_MSC_VER   0
 
#define FMT_MSC_WARNING(...)
 
#define FMT_HAS_FEATURE(x)   0
 
#define FMT_HAS_INCLUDE(x)   0
 
#define FMT_HAS_CPP_ATTRIBUTE(x)   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_USE_CONSTEXPR
 
#define FMT_CONSTEXPR
 
#define FMT_CONSTEXPR_DECL
 
#define FMT_CONSTEXPR_CHAR_TRAITS
 
#define FMT_OVERRIDE
 
#define FMT_EXCEPTIONS   1
 
#define FMT_USE_NOEXCEPT   0
 
#define FMT_DETECTED_NOEXCEPT   throw()
 
#define FMT_HAS_CXX11_NOEXCEPT   0
 
#define FMT_NOEXCEPT   FMT_DETECTED_NOEXCEPT
 
#define FMT_NORETURN
 
#define FMT_MAYBE_UNUSED
 
#define FMT_FALLTHROUGH
 
#define FMT_USE_FLOAT   1
 
#define FMT_USE_DOUBLE   1
 
#define FMT_USE_LONG_DOUBLE   1
 
#define FMT_INLINE   inline
 
#define FMT_USE_INLINE_NAMESPACES   0
 
#define FMT_INLINE_NAMESPACE   namespace
 
#define FMT_END_NAMESPACE
 
#define FMT_BEGIN_NAMESPACE
 
#define FMT_MODULE_EXPORT
 
#define FMT_MODULE_EXPORT_BEGIN
 
#define FMT_MODULE_EXPORT_END
 
#define FMT_BEGIN_DETAIL_NAMESPACE   namespace detail {
 
#define FMT_END_DETAIL_NAMESPACE   }
 
#define FMT_CLASS_API
 
#define FMT_API
 
#define FMT_GCC_VISIBILITY_HIDDEN
 
#define FMT_UNICODE   !FMT_MSC_VER
 
#define FMT_CONSTEVAL
 
#define FMT_USE_NONTYPE_TEMPLATE_PARAMETERS   0
 
#define FMT_ENABLE_IF(...)   enable_if_t<(__VA_ARGS__), int> = 0
 
#define FMT_ASSERT(condition, message)
 
#define FMT_USE_INT128   0
 
#define FMT_TYPE_CONSTANT(Type, constant)
 
#define FMT_BUFFER_CONTEXT(Char)   basic_format_context<detail::buffer_appender<Char>, Char>
 

Typedefs

template<bool B, class T = void>
using enable_if_t = typename std::enable_if< B, T >::type
 
template<bool B, class T , class F >
using conditional_t = typename std::conditional< B, T, F >::type
 
template<bool B>
using bool_constant = std::integral_constant< bool, B >
 
template<typename T >
using remove_reference_t = typename std::remove_reference< T >::type
 
template<typename T >
using remove_cvref_t = typename std::remove_cv< remove_reference_t< T >>::type
 
template<typename T >
using type_identity_t = typename type_identity< T >::type
 
using string_view = basic_string_view< char >
 
template<typename S >
using char_t = typename detail::char_t_impl< S >::type
 
using format_parse_context = basic_format_parse_context< char >
 
template<typename T , typename Context >
using has_formatter = std::is_constructible< typename Context::template formatter_type< T >>
 
template<typename T >
using buffer_appender = conditional_t< std::is_same< T, char >::value, appender, std::back_insert_iterator< buffer< T >>>
 
template<typename T , typename Char >
using has_fallback_formatter = std::is_constructible< fallback_formatter< T, Char >>
 
using long_type = conditional_t< long_short, int, long long >
 
using ulong_type = conditional_t< long_short, unsigned, unsigned long long >
 
template<typename T , typename Context >
using mapped_type_constant = type_constant< decltype(arg_mapper< Context >().map(std::declval< const T & >())), typename Context::char_type >
 
template<typename... >
using void_t = void
 
template<typename Char >
using buffer_context = basic_format_context< detail::buffer_appender< Char >, Char >
 
using format_context = buffer_context< char >
 
template<typename T , typename Char = char>
using is_formattable = bool_constant< !std::is_same< decltype(detail::arg_mapper< buffer_context< Char >>().map(std::declval< T >())), detail::unformattable >::value &&!detail::has_fallback_formatter< T, Char >::value >
 
using format_args = basic_format_args< format_context >
 
using align_t = align::type
 
using sign_t = sign::type
 
using format_specs = basic_format_specs< char >
 
template<typename... Args>
using format_string = basic_format_string< char, type_identity_t< Args >...>
 

Enumerations

enum  int128_t
 
enum  uint128_t
 
enum  type {
  type::none_type, type::int_type, type::uint_type, type::long_long_type,
  type::ulong_long_type, type::int128_type, type::uint128_type, type::bool_type,
  type::char_type, type::last_integer_type = char_type, type::float_type, type::double_type,
  type::long_double_type, type::last_numeric_type = long_double_type, type::cstring_type, type::string_type,
  type::pointer_type, type::custom_type
}
 
enum  { long_short = sizeof(long) == sizeof(int) }
 
enum  { packed_arg_bits = 4 }
 
enum  { max_packed_args = 62 / packed_arg_bits }
 
enum  : unsigned long long { is_unpacked_bit = 1ULL << 63 }
 
enum  : unsigned long long { has_named_args_bit = 1ULL << 62 }
 
enum  align::type {
  align::none, align::left, align::right, align::center,
  align::numeric
}
 
enum  sign::type { sign::none, sign::minus, sign::plus, sign::space }
 
enum  arg_id_kind { arg_id_kind::none, arg_id_kind::index, arg_id_kind::name }
 
enum  float_format : unsigned char { float_format::general, float_format::exp, float_format::fixed, float_format::hex }
 

Functions

FMT_BEGIN_DETAIL_NAMESPACE
constexpr FMT_INLINE auto 
is_constant_evaluated () FMT_NOEXCEPT-> bool
 
template<typename T >
constexpr auto const_check (T value) -> T
 
FMT_NORETURN FMT_API void assert_fail (const char *file, int line, const char *message)
 
template<typename T >
auto convert_for_visit (T) -> monostate
 
template<typename Int >
FMT_CONSTEXPR auto to_unsigned (Int value) -> typename std::make_unsigned< Int >::type
 
 FMT_MSC_WARNING (suppress:4566) const expr unsigned char micro[]
 
constexpr auto is_utf8 () -> bool
 
template<typename Char , FMT_ENABLE_IF(is_char< Char >::value) >
FMT_INLINE auto to_string_view (const Char *s) -> basic_string_view< Char >
 
template<typename Char , typename Traits , typename Alloc >
auto to_string_view (const std::basic_string< Char, Traits, Alloc > &s) -> basic_string_view< Char >
 
template<typename Char >
constexpr auto to_string_view (basic_string_view< Char > s) -> basic_string_view< Char >
 
template<typename Char , FMT_ENABLE_IF(!std::is_empty< detail::std_string_view< Char >>::value) >
auto to_string_view (detail::std_string_view< Char > s) -> basic_string_view< Char >
 
template<typename S , FMT_ENABLE_IF(is_compile_string< S >::value) >
constexpr auto to_string_view (const S &s) -> basic_string_view< typename S::char_type >
 
FMT_BEGIN_DETAIL_NAMESPACE void to_string_view (...)
 
template<typename... , typename S , FMT_ENABLE_IF(!is_compile_string< S >::value) >
FMT_INLINE void check_format_string (const S &)
 
template<typename... , typename S , FMT_ENABLE_IF(is_compile_string< S >::value) >
void check_format_string (S)
 
template<typename Container >
FMT_BEGIN_DETAIL_NAMESPACE auto get_container (std::back_insert_iterator< Container > it) -> Container &
 
template<typename Char , typename InputIt , typename OutputIt >
FMT_CONSTEXPR auto copy_str (InputIt begin, InputIt end, OutputIt out) -> OutputIt
 
template<typename Char , FMT_ENABLE_IF(std::is_same< Char, char >::value) >
FMT_CONSTEXPR auto copy_str (const Char *begin, const Char *end, Char *out) -> Char *
 
template<typename T , typename OutputIt >
auto get_buffer (OutputIt out) -> iterator_buffer< OutputIt, T >
 
template<typename Buffer >
auto get_iterator (Buffer &buf) -> decltype(buf.out())
 
template<typename T >
auto get_iterator (buffer< T > &buf) -> buffer_appender< T >
 
template<typename Char >
void init_named_args (named_arg_info< Char > *, int, int)
 
template<typename Char , typename T , typename... Tail, FMT_ENABLE_IF(!is_named_arg< T >::value) >
void init_named_args (named_arg_info< Char > *named_args, int arg_count, int named_arg_count, const T &, const Tail &...args)
 
template<typename... Args>
FMT_CONSTEXPR FMT_INLINE void init_named_args (std::nullptr_t, int, int, const Args &...)
 
template<bool B = false>
constexpr auto count () -> size_t
 
template<bool B1, bool B2, bool... Tail>
constexpr auto count () -> size_t
 
template<typename... Args>
constexpr auto count_named_args () -> size_t
 
 FMT_TYPE_CONSTANT (int, int_type)
 
 FMT_TYPE_CONSTANT (unsigned, uint_type)
 
 FMT_TYPE_CONSTANT (long long, long_long_type)
 
 FMT_TYPE_CONSTANT (unsigned long long, ulong_long_type)
 
 FMT_TYPE_CONSTANT (int128_t, int128_type)
 
 FMT_TYPE_CONSTANT (uint128_t, uint128_type)
 
 FMT_TYPE_CONSTANT (bool, bool_type)
 
 FMT_TYPE_CONSTANT (Char, char_type)
 
 FMT_TYPE_CONSTANT (float, float_type)
 
 FMT_TYPE_CONSTANT (double, double_type)
 
 FMT_TYPE_CONSTANT (long double, long_double_type)
 
 FMT_TYPE_CONSTANT (const Char *, cstring_type)
 
 FMT_TYPE_CONSTANT (basic_string_view< Char >, string_type)
 
 FMT_TYPE_CONSTANT (const void *, pointer_type)
 
constexpr bool is_integral_type (type t)
 
constexpr bool is_arithmetic_type (type t)
 
template<typename Context , typename T >
FMT_CONSTEXPR auto make_arg (const T &value) -> basic_format_arg< Context >
 
template<typename Visitor , typename Context >
FMT_CONSTEXPR FMT_INLINE auto visit_format_arg (Visitor &&vis, const basic_format_arg< Context > &arg) -> decltype(vis(0))
 
template<typename Char , typename InputIt >
FMT_BEGIN_DETAIL_NAMESPACE auto copy_str (InputIt begin, InputIt end, appender out) -> appender
 
template<typename >
constexpr auto encode_types () -> unsigned long long
 
template<typename Context , typename Arg , typename... Args>
constexpr auto encode_types () -> unsigned long long
 
template<bool IS_PACKED, typename Context , type , typename T , FMT_ENABLE_IF(IS_PACKED) >
FMT_CONSTEXPR FMT_INLINE auto make_arg (const T &val) -> value< Context >
 
template<bool IS_PACKED, typename Context , type , typename T , FMT_ENABLE_IF(!IS_PACKED) >
auto make_arg (const T &value) -> basic_format_arg< Context >
 
template<typename Context = format_context, typename... Args>
constexpr auto make_format_args (const Args &...args) -> format_arg_store< Context, Args...>
 
template<typename Char , typename T >
auto arg (const Char *name, const T &arg) -> detail::named_arg< Char, T >
 
FMT_BEGIN_DETAIL_NAMESPACE void throw_format_error (const char *message)
 
template<typename Char >
constexpr bool is_ascii_letter (Char c)
 
template<typename Char , FMT_ENABLE_IF(std::is_integral< Char >::value) >
constexpr auto to_ascii (Char value) -> Char
 
template<typename Char >
FMT_CONSTEXPR auto code_point_length (const Char *begin) -> int
 
template<bool IS_CONSTEXPR, typename T , typename Ptr = const T*>
FMT_CONSTEXPR auto find (Ptr first, Ptr last, T value, Ptr &out) -> bool
 
template<>
auto find< false, char > (const char *first, const char *last, char value, const char *&out) -> bool
 
template<typename Char >
FMT_CONSTEXPR auto parse_nonnegative_int (const Char *&begin, const Char *end, int error_value) noexcept-> int
 
template<typename Char , typename Handler >
FMT_CONSTEXPR auto parse_align (const Char *begin, const Char *end, Handler &&handler) -> const Char *
 
template<typename Char >
FMT_CONSTEXPR bool is_name_start (Char c)
 
template<typename Char , typename IDHandler >
FMT_CONSTEXPR auto do_parse_arg_id (const Char *begin, const Char *end, IDHandler &&handler) -> const Char *
 
template<typename Char , typename IDHandler >
FMT_CONSTEXPR FMT_INLINE auto parse_arg_id (const Char *begin, const Char *end, IDHandler &&handler) -> const Char *
 
template<typename Char , typename Handler >
FMT_CONSTEXPR auto parse_width (const Char *begin, const Char *end, Handler &&handler) -> const Char *
 
template<typename Char , typename Handler >
FMT_CONSTEXPR auto parse_precision (const Char *begin, const Char *end, Handler &&handler) -> const Char *
 
template<typename Char , typename SpecHandler >
FMT_CONSTEXPR FMT_INLINE auto parse_format_specs (const Char *begin, const Char *end, SpecHandler &&handler) -> const Char *
 
template<typename Char , typename Handler >
FMT_CONSTEXPR auto parse_replacement_field (const Char *begin, const Char *end, Handler &&handler) -> const Char *
 
template<bool IS_CONSTEXPR, typename Char , typename Handler >
FMT_CONSTEXPR FMT_INLINE void parse_format_string (basic_string_view< Char > format_str, Handler &&handler)
 
template<typename T , typename ParseContext >
FMT_CONSTEXPR auto parse_format_specs (ParseContext &ctx) -> decltype(ctx.begin())
 
template<typename ErrorHandler >
FMT_CONSTEXPR void check_int_type_spec (char spec, ErrorHandler &&eh)
 
template<typename Char , typename ErrorHandler = error_handler>
FMT_CONSTEXPR auto check_char_specs (const basic_format_specs< Char > &specs, ErrorHandler &&eh={}) -> bool
 
template<typename ErrorHandler = error_handler, typename Char >
FMT_CONSTEXPR auto parse_float_type_spec (const basic_format_specs< Char > &specs, ErrorHandler &&eh={}) -> float_specs
 
template<typename Char , typename ErrorHandler = error_handler>
FMT_CONSTEXPR auto check_cstring_type_spec (Char spec, ErrorHandler &&eh={}) -> bool
 
template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR void check_string_type_spec (Char spec, ErrorHandler &&eh)
 
template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR void check_pointer_type_spec (Char spec, ErrorHandler &&eh)
 
template<typename... Args, typename Char >
FMT_CONSTEXPR auto get_arg_index_by_name (basic_string_view< Char > name) -> int
 
template<typename Char >
void vformat_to (buffer< Char > &buf, basic_string_view< Char > fmt, basic_format_args< FMT_BUFFER_CONTEXT(type_identity_t< Char >)> args, detail::locale_ref loc={})
 
FMT_API void vprint_mojibake (std::FILE *, string_view, format_args)
 
template<typename S >
auto runtime (const S &s) -> basic_runtime< char_t< S >>
 
FMT_API auto vformat (string_view fmt, format_args args) -> std::string
 
template<typename... T>
FMT_INLINE auto format (format_string< T...> fmt, T &&...args) -> std::string
 
template<typename OutputIt , FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value) >
auto vformat_to (OutputIt out, string_view fmt, format_args args) -> OutputIt
 
template<typename OutputIt , typename... T, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value) >
FMT_INLINE auto format_to (OutputIt out, format_string< T...> fmt, T &&...args) -> OutputIt
 
template<typename OutputIt , typename... T, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value) >
auto vformat_to_n (OutputIt out, size_t n, string_view fmt, format_args args) -> format_to_n_result< OutputIt >
 
template<typename OutputIt , typename... T, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value) >
FMT_INLINE auto format_to_n (OutputIt out, size_t n, format_string< T...> fmt, const T &...args) -> format_to_n_result< OutputIt >
 
template<typename... T>
FMT_INLINE auto formatted_size (format_string< T...> fmt, T &&...args) -> size_t
 
FMT_API void vprint (string_view fmt, format_args args)
 
FMT_API void vprint (std::FILE *f, string_view fmt, format_args args)
 
template<typename... T>
FMT_INLINE void print (format_string< T...> fmt, T &&...args)
 
template<typename... T>
FMT_INLINE void print (std::FILE *f, format_string< T...> fmt, T &&...args)
 

Variables

constexpr int invalid_arg_index = -1
 

Macro Definition Documentation

#define FMT_API

Definition at line 263 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)))
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
FMT_NORETURN FMT_API void assert_fail(const char *file, int line, const char *message)
Definition: format-inl.h:34

Definition at line 365 of file core.h.

#define FMT_BEGIN_DETAIL_NAMESPACE   namespace detail {

Definition at line 243 of file core.h.

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

Definition at line 234 of file core.h.

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

Definition at line 1652 of file core.h.

#define FMT_CLANG_VERSION   0

Definition at line 24 of file core.h.

#define FMT_CLASS_API

Definition at line 255 of file core.h.

#define FMT_CONSTEVAL

Definition at line 295 of file core.h.

#define FMT_CONSTEXPR

Definition at line 98 of file core.h.

#define FMT_CONSTEXPR_CHAR_TRAITS

Definition at line 115 of file core.h.

#define FMT_CONSTEXPR_DECL

Definition at line 99 of file core.h.

#define FMT_DETECTED_NOEXCEPT   throw()

Definition at line 147 of file core.h.

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

Definition at line 341 of file core.h.

#define FMT_END_DETAIL_NAMESPACE   }

Definition at line 244 of file core.h.

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

Definition at line 229 of file core.h.

#define FMT_EXCEPTIONS   1

Definition at line 133 of file core.h.

#define FMT_FALLTHROUGH

Definition at line 191 of file core.h.

#define FMT_GCC_PRAGMA (   arg)

Definition at line 32 of file core.h.

#define FMT_GCC_VERSION   0

Definition at line 31 of file core.h.

#define FMT_GCC_VISIBILITY_HIDDEN

Definition at line 269 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 148 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 38 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 44 of file core.h.

#define FMT_INLINE   inline

Definition at line 208 of file core.h.

#define FMT_INLINE_NAMESPACE   namespace

Definition at line 228 of file core.h.

#define FMT_MAYBE_UNUSED

Definition at line 172 of file core.h.

#define FMT_MODULE_EXPORT

Definition at line 240 of file core.h.

#define FMT_MODULE_EXPORT_BEGIN

Definition at line 241 of file core.h.

#define FMT_MODULE_EXPORT_END

Definition at line 242 of file core.h.

#define FMT_MSC_VER   0

Definition at line 57 of file core.h.

#define FMT_MSC_WARNING (   ...)

Definition at line 58 of file core.h.

#define FMT_NOEXCEPT   FMT_DETECTED_NOEXCEPT

Definition at line 153 of file core.h.

#define FMT_NORETURN

Definition at line 165 of file core.h.

#define FMT_NVCC   0

Definition at line 50 of file core.h.

#define FMT_OVERRIDE

Definition at line 123 of file core.h.

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

Definition at line 1086 of file core.h.

#define FMT_UNICODE   !FMT_MSC_VER

Definition at line 284 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:44
#define FMT_GCC_VERSION
Definition: core.h:31
#define FMT_HAS_FEATURE(x)
Definition: core.h:64

Definition at line 89 of file core.h.

#define FMT_USE_DOUBLE   1

Definition at line 198 of file core.h.

#define FMT_USE_FLOAT   1

Definition at line 195 of file core.h.

#define FMT_USE_INLINE_NAMESPACES   0

Definition at line 217 of file core.h.

#define FMT_USE_INT128   0

Definition at line 392 of file core.h.

#define FMT_USE_LONG_DOUBLE   1

Definition at line 201 of file core.h.

#define FMT_USE_NOEXCEPT   0

Definition at line 139 of file core.h.

#define FMT_USE_NONTYPE_TEMPLATE_PARAMETERS   0

Definition at line 305 of file core.h.

#define FMT_VERSION   80000

Definition at line 19 of file core.h.

Typedef Documentation

Definition at line 1872 of file core.h.

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

Definition at line 323 of file core.h.

template<typename T >
using buffer_appender = conditional_t<std::is_same<T, char>::value, appender, std::back_insert_iterator<buffer<T>>>

Definition at line 956 of file core.h.

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

Definition at line 1648 of file core.h.

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

String's character type.

Definition at line 621 of file core.h.

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

Definition at line 322 of file core.h.

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

Definition at line 320 of file core.h.

An alias to basic_format_args<format_context>.

Definition at line 1865 of file core.h.

Definition at line 1649 of file core.h.

Definition at line 697 of file core.h.

Definition at line 1928 of file core.h.

template<typename... Args>
using format_string = basic_format_string<char, type_identity_t<Args>...>

Definition at line 2868 of file core.h.

template<typename T , typename Char >
using has_fallback_formatter = std::is_constructible<fallback_formatter<T, Char>>

Definition at line 980 of file core.h.

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

Definition at line 714 of file core.h.

template<typename T , typename Char = char>
using is_formattable = bool_constant< !std::is_same<decltype(detail::arg_mapper<buffer_context<Char>>().map( std::declval<T>())), detail::unformattable>::value && !detail::has_fallback_formatter<T, Char>::value>

Definition at line 1660 of file core.h.

using long_type = conditional_t<long_short, int, long long>

Definition at line 1207 of file core.h.

template<typename T , typename Context >
using mapped_type_constant = type_constant<decltype(arg_mapper<Context>().map(std::declval<const T&>())), typename Context::char_type>

Definition at line 1358 of file core.h.

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

Definition at line 327 of file core.h.

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

Definition at line 325 of file core.h.

using sign_t = sign::type

Definition at line 1876 of file core.h.

Definition at line 522 of file core.h.

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

Definition at line 329 of file core.h.

using ulong_type = conditional_t<long_short, unsigned, unsigned long long>

Definition at line 1208 of file core.h.

template<typename... >
using void_t = void

Definition at line 1512 of file core.h.

Enumeration Type Documentation

anonymous enum
Enumerator
long_short 

Definition at line 1206 of file core.h.

anonymous enum
Enumerator
packed_arg_bits 

Definition at line 1360 of file core.h.

anonymous enum
Enumerator
max_packed_args 

Definition at line 1362 of file core.h.

anonymous enum : unsigned long long
Enumerator
is_unpacked_bit 

Definition at line 1363 of file core.h.

anonymous enum : unsigned long long
Enumerator
has_named_args_bit 

Definition at line 1364 of file core.h.

enum arg_id_kind
strong
Enumerator
none 
index 
name 

Definition at line 1932 of file core.h.

enum float_format : unsigned char
strong
Enumerator
general 
exp 
fixed 
hex 

Definition at line 2521 of file core.h.

enum int128_t
strong

Definition at line 395 of file core.h.

enum typedef GLenum type
strong
Enumerator
none_type 
int_type 
uint_type 
long_long_type 
ulong_long_type 
int128_type 
uint128_type 
bool_type 
char_type 
last_integer_type 
float_type 
double_type 
long_double_type 
last_numeric_type 
cstring_type 
string_type 
pointer_type 
custom_type 
Examples:
expr/functions.C, GUI/GUI_PrimFramework.C, and SOP/SOP_PrimVOP.C.

Definition at line 1059 of file core.h.

enum uint128_t
strong

Definition at line 396 of file core.h.

Function Documentation

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

Returns a named argument to be used in a formatting function. It should only be used in a call to a formatting function or dynamic_format_arg_store::push_back.

Example**::

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

Definition at line 1736 of file core.h.

FMT_NORETURN FMT_API void assert_fail ( const char *  file,
int  line,
const char *  message 
)

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

template<typename Char , typename ErrorHandler = error_handler>
FMT_CONSTEXPR auto check_char_specs ( const basic_format_specs< Char > &  specs,
ErrorHandler &&  eh = {} 
) -> bool

Definition at line 2509 of file core.h.

template<typename Char , typename ErrorHandler = error_handler>
FMT_CONSTEXPR auto check_cstring_type_spec ( Char  spec,
ErrorHandler &&  eh = {} 
) -> bool

Definition at line 2584 of file core.h.

template<typename... , typename S , FMT_ENABLE_IF(!is_compile_string< S >::value) >
FMT_INLINE void check_format_string ( const S &  )

Definition at line 601 of file core.h.

template<typename... , typename S , FMT_ENABLE_IF(is_compile_string< S >::value) >
void check_format_string ( format_str)

Definition at line 2728 of file core.h.

template<typename ErrorHandler >
FMT_CONSTEXPR void check_int_type_spec ( char  spec,
ErrorHandler &&  eh 
)

Definition at line 2490 of file core.h.

template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR void check_pointer_type_spec ( Char  spec,
ErrorHandler &&  eh 
)

Definition at line 2597 of file core.h.

template<typename Char , typename ErrorHandler >
FMT_CONSTEXPR void check_string_type_spec ( Char  spec,
ErrorHandler &&  eh 
)

Definition at line 2592 of file core.h.

template<typename Char >
FMT_CONSTEXPR auto code_point_length ( const Char *  begin) -> int

Definition at line 2075 of file core.h.

template<typename T >
constexpr auto const_check ( value) -> T

Definition at line 355 of file core.h.

template<typename T >
auto convert_for_visit ( ) -> monostate
inline

Definition at line 398 of file core.h.

template<typename Char , typename InputIt , typename OutputIt >
FMT_CONSTEXPR auto copy_str ( InputIt  begin,
InputIt  end,
OutputIt  out 
) -> OutputIt

Definition at line 738 of file core.h.

template<typename Char , FMT_ENABLE_IF(std::is_same< Char, char >::value) >
FMT_CONSTEXPR auto copy_str ( const Char *  begin,
const Char *  end,
Char *  out 
) -> Char*

Definition at line 745 of file core.h.

template<typename Char , typename InputIt >
FMT_BEGIN_DETAIL_NAMESPACE auto copy_str ( InputIt  begin,
InputIt  end,
appender  out 
) -> appender

Definition at line 1501 of file core.h.

template<bool B = false>
constexpr auto count ( ) -> size_t

Definition at line 1050 of file core.h.

template<bool B1, bool B2, bool... Tail>
constexpr auto count ( ) -> size_t

Definition at line 1051 of file core.h.

template<typename... Args>
constexpr auto count_named_args ( ) -> size_t

Definition at line 1055 of file core.h.

template<typename Char , typename IDHandler >
FMT_CONSTEXPR auto do_parse_arg_id ( const Char *  begin,
const Char *  end,
IDHandler &&  handler 
) -> const Char*

Definition at line 2175 of file core.h.

template<typename >
constexpr auto encode_types ( ) -> unsigned long long

Definition at line 1553 of file core.h.

template<typename Context , typename Arg , typename... Args>
constexpr auto encode_types ( ) -> unsigned long long

Definition at line 1558 of file core.h.

template<bool IS_CONSTEXPR, typename T , typename Ptr = const T*>
FMT_CONSTEXPR auto find ( Ptr  first,
Ptr  last,
value,
Ptr &  out 
) -> bool

Definition at line 2089 of file core.h.

template<>
auto find< false, char > ( const char *  first,
const char *  last,
char  value,
const char *&  out 
) -> bool
inline

Definition at line 2097 of file core.h.

FMT_MSC_WARNING ( suppress:4566  ) const
FMT_TYPE_CONSTANT ( int  ,
int_type   
)
FMT_TYPE_CONSTANT ( unsigned  ,
uint_type   
)
FMT_TYPE_CONSTANT ( long  long,
long_long_type   
)
FMT_TYPE_CONSTANT ( unsigned long  long,
ulong_long_type   
)
FMT_TYPE_CONSTANT ( int128_t  ,
int128_type   
)
FMT_TYPE_CONSTANT ( uint128_t  ,
uint128_type   
)
FMT_TYPE_CONSTANT ( bool  ,
bool_type   
)
FMT_TYPE_CONSTANT ( Char  ,
char_type   
)
FMT_TYPE_CONSTANT ( float  ,
float_type   
)
FMT_TYPE_CONSTANT ( double  ,
double_type   
)
FMT_TYPE_CONSTANT ( long  double,
long_double_type   
)
FMT_TYPE_CONSTANT ( const Char *  ,
cstring_type   
)
FMT_TYPE_CONSTANT ( basic_string_view< Char >  ,
string_type   
)
FMT_TYPE_CONSTANT ( const void ,
pointer_type   
)
template<typename... T>
FMT_INLINE auto format ( format_string< T...>  fmt,
T &&...  args 
) -> std::string

Formats args according to specifications in fmt and returns the result as a string.

Example**::

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

Definition at line 2889 of file core.h.

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

Formats args according to specifications in fmt, writes the result to the output iterator out and returns the iterator past the end of the output range.

Example**::

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

Definition at line 2917 of file core.h.

template<typename OutputIt , typename... T, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value) >
FMT_INLINE auto format_to_n ( OutputIt  out,
size_t  n,
format_string< T...>  fmt,
const T &...  args 
) -> format_to_n_result<OutputIt>

Formats args according to specifications in fmt, writes up to n characters of the result to the output iterator out and returns the total (not truncated) output size and the iterator past the end of the output range.

Definition at line 2949 of file core.h.

template<typename... T>
FMT_INLINE auto formatted_size ( format_string< T...>  fmt,
T &&...  args 
) -> size_t

Returns the number of chars in the output of format(fmt, args...).

Definition at line 2956 of file core.h.

template<typename... Args, typename Char >
FMT_CONSTEXPR auto get_arg_index_by_name ( basic_string_view< Char >  name) -> int

Definition at line 2667 of file core.h.

template<typename T , typename OutputIt >
auto get_buffer ( OutputIt  out) -> iterator_buffer<OutputIt, T>

Definition at line 960 of file core.h.

template<typename Container >
FMT_BEGIN_DETAIL_NAMESPACE auto get_container ( std::back_insert_iterator< Container >  it) -> Container&
inline

Definition at line 727 of file core.h.

template<typename Buffer >
auto get_iterator ( Buffer &  buf) -> decltype(buf.out())

Definition at line 965 of file core.h.

template<typename T >
auto get_iterator ( buffer< T > &  buf) -> buffer_appender<T>

Definition at line 968 of file core.h.

template<typename Char >
void init_named_args ( named_arg_info< Char > *  ,
int  ,
int   
)
inline

Definition at line 1023 of file core.h.

template<typename Char , typename T , typename... Tail, FMT_ENABLE_IF(!is_named_arg< T >::value) >
void init_named_args ( named_arg_info< Char > *  named_args,
int  arg_count,
int  named_arg_count,
const T &  arg,
const Tail &...  args 
)

Definition at line 1033 of file core.h.

template<typename... Args>
FMT_CONSTEXPR FMT_INLINE void init_named_args ( std::nullptr_t  ,
int  ,
int  ,
const Args &  ... 
)

Definition at line 1047 of file core.h.

constexpr bool is_arithmetic_type ( type  t)

Definition at line 1110 of file core.h.

template<typename Char >
constexpr bool is_ascii_letter ( Char  c)

Definition at line 2059 of file core.h.

FMT_BEGIN_DETAIL_NAMESPACE constexpr FMT_INLINE auto is_constant_evaluated ( ) -> bool

Definition at line 346 of file core.h.

constexpr bool is_integral_type ( type  t)

Definition at line 1106 of file core.h.

template<typename Char >
FMT_CONSTEXPR bool is_name_start ( Char  c)

Definition at line 2170 of file core.h.

constexpr auto is_utf8 ( ) -> bool

Definition at line 413 of file core.h.

template<typename Context , typename T >
FMT_CONSTEXPR auto make_arg ( const T &  value) -> basic_format_arg<Context>

Definition at line 1564 of file core.h.

template<bool IS_PACKED, typename Context , type , typename T , FMT_ENABLE_IF(IS_PACKED) >
FMT_CONSTEXPR FMT_INLINE auto make_arg ( const T &  val) -> value<Context>

Definition at line 1576 of file core.h.

template<bool IS_PACKED, typename Context , type , typename T , FMT_ENABLE_IF(!IS_PACKED) >
auto make_arg ( const T &  value) -> basic_format_arg<Context>
inline

Definition at line 1587 of file core.h.

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

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 1719 of file core.h.

template<typename Char , typename Handler >
FMT_CONSTEXPR auto parse_align ( const Char *  begin,
const Char *  end,
Handler &&  handler 
) -> const Char*

Definition at line 2131 of file core.h.

template<typename Char , typename IDHandler >
FMT_CONSTEXPR FMT_INLINE auto parse_arg_id ( const Char *  begin,
const Char *  end,
IDHandler &&  handler 
) -> const Char*

Definition at line 2205 of file core.h.

template<typename ErrorHandler = error_handler, typename Char >
FMT_CONSTEXPR auto parse_float_type_spec ( const basic_format_specs< Char > &  specs,
ErrorHandler &&  eh = {} 
) -> float_specs

Definition at line 2540 of file core.h.

template<typename Char , typename SpecHandler >
FMT_CONSTEXPR FMT_INLINE auto parse_format_specs ( const Char *  begin,
const Char *  end,
SpecHandler &&  handler 
) -> const Char*

Definition at line 2288 of file core.h.

template<typename T , typename ParseContext >
FMT_CONSTEXPR auto parse_format_specs ( ParseContext &  ctx) -> decltype(ctx.begin())

Definition at line 2446 of file core.h.

template<bool IS_CONSTEXPR, typename Char , typename Handler >
FMT_CONSTEXPR FMT_INLINE void parse_format_string ( basic_string_view< Char >  format_str,
Handler &&  handler 
)

Definition at line 2393 of file core.h.

template<typename Char >
FMT_CONSTEXPR auto parse_nonnegative_int ( const Char *&  begin,
const Char *  end,
int  error_value 
) -> int
noexcept

Definition at line 2107 of file core.h.

template<typename Char , typename Handler >
FMT_CONSTEXPR auto parse_precision ( const Char *  begin,
const Char *  end,
Handler &&  handler 
) -> const Char*

Definition at line 2248 of file core.h.

template<typename Char , typename Handler >
FMT_CONSTEXPR auto parse_replacement_field ( const Char *  begin,
const Char *  end,
Handler &&  handler 
) -> const Char*

Definition at line 2353 of file core.h.

template<typename Char , typename Handler >
FMT_CONSTEXPR auto parse_width ( const Char *  begin,
const Char *  end,
Handler &&  handler 
) -> const Char*

Definition at line 2214 of file core.h.

template<typename... T>
FMT_INLINE void print ( format_string< T...>  fmt,
T &&...  args 
)

Formats args according to specifications in fmt and writes the output to stdout.

Example**::

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

Definition at line 2976 of file core.h.

template<typename... T>
FMT_INLINE void print ( std::FILE *  f,
format_string< T...>  fmt,
T &&...  args 
)

Formats args according to specifications in fmt and writes the output to the file f.

Example**::

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

Definition at line 2993 of file core.h.

template<typename S >
auto runtime ( const S &  s) -> basic_runtime<char_t<S>>

Definition at line 2870 of file core.h.

FMT_BEGIN_DETAIL_NAMESPACE void throw_format_error ( const char *  message)
inline

Definition at line 810 of file format.h.

template<typename Char , FMT_ENABLE_IF(std::is_integral< Char >::value) >
constexpr auto to_ascii ( Char  value) -> Char

Definition at line 2065 of file core.h.

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

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 545 of file core.h.

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

Definition at line 550 of file core.h.

template<typename Char >
constexpr auto to_string_view ( basic_string_view< Char >  s) -> basic_string_view<Char>

Definition at line 556 of file core.h.

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

Definition at line 563 of file core.h.

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

Definition at line 576 of file core.h.

FMT_BEGIN_DETAIL_NAMESPACE void to_string_view (   ...)
template<typename Int >
FMT_CONSTEXPR auto to_unsigned ( Int  value) -> typename std::make_unsigned<Int>::type

Definition at line 405 of file core.h.

FMT_API auto vformat ( string_view  fmt,
format_args  args 
) -> std::string

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

template<typename Char >
void vformat_to ( buffer< Char > &  buf,
basic_string_view< Char >  fmt,
basic_format_args< FMT_BUFFER_CONTEXT(type_identity_t< Char >)>  args,
detail::locale_ref  loc = {} 
)
template<typename OutputIt , FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value) >
auto vformat_to ( OutputIt  out,
string_view  fmt,
format_args  args 
) -> OutputIt

Formats a string and writes the output to out.

Definition at line 2896 of file core.h.

template<typename OutputIt , typename... T, FMT_ENABLE_IF(detail::is_output_iterator< OutputIt, char >::value) >
auto vformat_to_n ( OutputIt  out,
size_t  n,
string_view  fmt,
format_args  args 
) -> format_to_n_result<OutputIt>

Definition at line 2931 of file core.h.

template<typename Visitor , typename Context >
FMT_CONSTEXPR 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 1458 of file core.h.

FMT_API void vprint ( string_view  fmt,
format_args  args 
)

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

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

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

void vprint_mojibake ( std::FILE *  ,
string_view  ,
format_args   
)
inline

Definition at line 2745 of file core.h.

Variable Documentation

constexpr int invalid_arg_index = -1

Definition at line 2651 of file core.h.