Loading...
Searching...
No Matches
core.h File Reference #include <cstdio> #include <cstring> #include <iterator> #include <string> #include <type_traits> Go to the source code of this file.
Macro Definition Documentation◆ FMT_API
Definition at line 177 of file core.h. Referenced by report_system_error(). ◆ FMT_ASSERT
Value:
((condition) \
? void() \
: fmt::internal::assert_fail(__FILE__, __LINE__, (message)))
Definition at line 233 of file core.h. Referenced by bigint::divmod_assign(), internal::format_decimal(), internal::format_decimal(), internal::format_float(), text_style::get_background(), text_style::get_emphasis(), text_style::get_foreground(), internal::get_round_direction(), internal::grisu_gen_digits(), internal::is_arithmetic_type(), internal::is_integral_type(), fixed_handler::on_digit(), arg_formatter_base< Range, ErrorHandler >::operator()(), bigint::operator*=(), basic_memory_buffer< T, SIZE, Allocator >::operator=(), formatter< T, Char, enable_if_t< internal::type_constant< T, Char >::value !=internal::custom_type > >::parse(), internal::parse_align(), internal::parse_arg_id(), internal::parse_nonnegative_int(), internal::parse_width(), internal::safe_strerror(), internal::snprintf_float(), bigint::subtract_aligned(), internal::to_nonnegative_int(), internal::to_unsigned(), visit_format_arg(), and internal::write_exponent(). ◆ FMT_BEGIN_NAMESPACE
Value:
namespace fmt { \
FMT_INLINE_NAMESPACE v6 {
◆ FMT_CONSTEXPR
Definition at line 75 of file core.h. Referenced by internal::compile_to_parts(), and internal::parse_format_string(). ◆ FMT_CONSTEXPR_DECL
Definition at line 76 of file core.h. Referenced by internal::check_format_string(), and compiled_format_base< S, enable_if_t< is_compile_string< S >::value > >::parts(). ◆ FMT_DEPRECATED◆ FMT_DEPRECATED_ALIAS◆ FMT_DETECTED_NOEXCEPT◆ FMT_ENABLE_IF
◆ FMT_END_NAMESPACE◆ FMT_EXCEPTIONS◆ FMT_EXTERN◆ FMT_EXTERN_TEMPLATE_API◆ FMT_GCC_VERSION◆ FMT_HAS_CPP_ATTRIBUTE◆ FMT_HAS_CXX11_NOEXCEPT◆ FMT_HAS_FEATURE◆ FMT_HAS_GXX_CXX11◆ FMT_HAS_INCLUDE◆ FMT_INLINE_NAMESPACE◆ FMT_MSC_VER◆ FMT_NOEXCEPT◆ FMT_NORETURN◆ FMT_NVCC◆ FMT_OVERRIDE◆ FMT_TYPE_CONSTANT
◆ FMT_USE_CONSTEXPR
Value:
(FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \
(FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L)) && \
◆ FMT_USE_INT128◆ FMT_USE_NOEXCEPT◆ FMT_VERSIONTypedef Documentation◆ bool_constant
template<bool B>
◆ buffer_context
template<typename Char >
Initial value:
◆ char_t
template<typename S >
◆ conditional_t
template<bool B, class T , class F >
◆ enable_if_t
template<bool B, class T = void>
◆ FMT_DEPRECATED_ALIAS
Initial value:
◆ format_context
◆ format_parse_context
◆ has_formatter
template<typename T , typename Context >
◆ remove_const_t
template<typename T >
◆ remove_cvref_t
template<typename T >
◆ remove_reference_t
template<typename T >
◆ string_view
◆ void_t
template<typename... Ts>
◆ wformat_context
◆ wformat_parse_context
◆ wstring_view
Enumeration Type Documentation◆ char8_tFunction Documentation◆ arg() [1/2]
template<typename S , typename T , typename Char = char_t<S>>
\rst Returns a named argument to be used in a formatting function. The named argument holds a reference and does not extend the lifetime of its arguments. Consequently, a dangling reference can accidentally be created. The user should take care to only pass this function temporaries when the named argument is itself a temporary, as per the following example. Example**:: fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23)); \endrst Definition at line 1422 of file core.h. References arg(). Referenced by basic_format_context< OutputIt, Char >::arg(), arg(), internal::convert_arg(), named_arg_base< Char >::deserialize(), basic_format_args< Context >::do_get(), basic_printf_context< OutputIt, Char >::format(), formatter< tuple_arg_join< Char, T... >, Char >::format_args(), value< Context >::format_custom_arg(), basic_format_args< Context >::get(), internal::get_arg(), format_handler< ArgFormatter, Char, Context >::get_arg(), internal::get_dynamic_spec(), internal::make_arg(), arg_mapper< Context >::map(), format_handler< ArgFormatter, Char, Context >::on_arg_id(), format_handler< ArgFormatter, Char, Context >::on_format_specs(), format_handler< ArgFormatter, Char, Context >::on_replacement_field(), internal::cf::vformat_to(), and visit_format_arg(). ◆ arg() [2/2]
template<typename S , typename T , typename Char >
◆ format()
template<typename S , typename... Args, typename Char = char_t<S>>
\rst Formats arguments and returns the result as a string. Example**:: #include <fmt/core.h> std::string message = fmt::format("The answer is {}", 42); \endrst Definition at line 1475 of file core.h. References internal::make_args_checked(), to_string_view(), and internal::vformat(). Referenced by formatter< tuple_arg_join< Char, T... >, Char >::format(). ◆ format_to()
template<typename Container , typename S , typename... Args, FMT_ENABLE_IF( is_contiguous< Container >::value &&internal::is_string< S >::value) >
Definition at line 1448 of file core.h. References internal::make_args_checked(), to_string_view(), and vformat_to(). Referenced by formatter< internal::bigint >::format(), and formatter< RangeT, Char, enable_if_t< fmt::is_range< RangeT, Char >::value > >::format(). ◆ make_format_args()
template<typename Context = format_context, typename... Args>
\rst Constructs an Definition at line 1225 of file core.h. Referenced by buffered_file::print(), report_system_error(), and system_error::system_error(). ◆ print() [1/2]
template<typename S , typename... Args, FMT_ENABLE_IF(internal::is_string< S >::value) >
\rst Prints formatted data to Example**:: fmt::print("Elapsed time: {0:.2f} seconds", 1.23); \endrst Definition at line 1513 of file core.h. References to_string_view(), and vprint(). ◆ print() [2/2]
template<typename S , typename... Args, FMT_ENABLE_IF(internal::is_string< S >::value) >
\rst Prints formatted data to the file f. For wide format strings, f* should be in wide-oriented mode set via Example**:: fmt::print(stderr, "Don't {}!", "panic"); \endrst Definition at line 1497 of file core.h. References to_string_view(), and vprint(). ◆ to_string_view() [1/5]
template<typename Char >
◆ to_string_view() [2/5]
template<typename Char , FMT_ENABLE_IF(is_char< Char >::value) >
\rst Returns a string view of 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); \endrst Definition at line 397 of file core.h. Referenced by internal::check_format_string(), format(), format(), format(), format_to(), format_to(), format_to(), format_to(), format_to_n(), fprintf(), fprintf(), print(), print(), print(), printf(), sprintf(), vformat(), vformat(), vformat(), internal::vformat_to(), vformat_to(), vformat_to(), vformat_to(), vformat_to(), vfprintf(), vfprintf(), vprint(), vprintf(), and vsprintf(). ◆ to_string_view() [3/5]
template<typename S , FMT_ENABLE_IF(is_compile_string< S >::value) >
◆ to_string_view() [4/5]
template<typename Char , typename Traits , typename Alloc >
◆ to_string_view() [5/5]
template<typename Char , FMT_ENABLE_IF(!std::is_empty< internal::std_string_view< Char > >::value) >
◆ vformat()
template<typename S , typename Char = char_t<S>>
Definition at line 1457 of file core.h. References to_string_view(), and internal::vformat(). ◆ vformat_to()
template<typename OutputIt , typename S , typename Char = char_t<S>, FMT_ENABLE_IF( internal::is_contiguous_back_insert_iterator< OutputIt >::value) >
Formats a string and writes the output to Definition at line 1437 of file core.h. References internal::get_container(), to_string_view(), and internal::vformat_to(). Referenced by format_to(), format_to(), and vformat_to_n(). ◆ visit_format_arg()
template<typename Visitor , typename Context >
\rst Visits an argument dispatching to the appropriate visit method based on the argument type. For example, if the argument type is Definition at line 1004 of file core.h. References arg(), internal::bool_type, internal::char_type, internal::cstring_type, internal::custom_type, internal::double_type, internal::float_type, FMT_ASSERT, internal::int128_type, internal::int_type, internal::long_double_type, internal::long_long_type, internal::named_arg_type, internal::none_type, internal::pointer_type, internal::string_type, internal::uint128_type, internal::uint_type, and internal::ulong_long_type. Referenced by internal::convert_arg(), basic_printf_context< OutputIt, Char >::format(), formatter< T, Char, enable_if_t< internal::type_constant< T, Char >::value !=internal::custom_type > >::format(), dynamic_formatter< Char >::format(), internal::format_arg(), internal::get_dynamic_spec(), format_handler< ArgFormatter, Char, Context >::on_format_specs(), format_handler< ArgFormatter, Char, Context >::on_replacement_field(), basic_printf_context< OutputIt, Char >::parse_header(), and internal::cf::vformat_to(). ◆ vprint() [1/2]
Definition at line 1379 of file format-inl.h. References buffer< T >::data(), internal::fwrite_fully(), buffer< T >::size(), and internal::vformat_to(). ◆ vprint() [2/2]
Definition at line 1386 of file format-inl.h. References vprint().
|