WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
format-inl.h File Reference
#include <algorithm>
#include <cerrno>
#include <climits>
#include <cmath>
#include <exception>
#include "format.h"

Go to the source code of this file.

Classes

struct  detail::locale
struct  detail::numpunct< Char >
struct  detail::dragonbox::div_small_pow10_infos_struct
struct  detail::dragonbox::cache_accessor< float >
struct  detail::dragonbox::cache_accessor< float >::compute_mul_result
struct  detail::dragonbox::cache_accessor< float >::compute_mul_parity_result
struct  detail::dragonbox::cache_accessor< double >
struct  detail::dragonbox::cache_accessor< double >::compute_mul_result
struct  detail::dragonbox::cache_accessor< double >::compute_mul_parity_result
struct  formatter< detail::bigint >
struct  detail::span< T >
struct  detail::has_flockfile< F, Enable >
struct  detail::has_flockfile< F, void_t< decltype(flockfile(&std::declval< F & >()))> >
class  detail::file_base< F >
class  detail::glibc_file< F >
class  detail::apple_file< F >
class  detail::fallback_file< F >
class  detail::file_print_buffer< F, Enable >
class  detail::file_print_buffer< F, enable_if_t< has_flockfile< F >::value > >
struct  detail::singleton

Namespaces

namespace  detail
 Converts a string literal into a format string that will be parsed at compile time and converted into efficient formatting code.
namespace  detail::dragonbox

Macros

#define FMT_FUNC
#define FMT_USE_FALLBACK_FILE   0

Typedefs

using detail::file_ref = decltype(get_file(static_cast<FILE*>(nullptr), 0))

Functions

FMT_BEGIN_NAMESPACE FMT_FUNC void assert_fail (const char *file, int line, const char *message)
template<typename Facet>
Facet detail::use_facet (locale)
FMT_API void detail::format_error_code (buffer< char > &out, int error_code, string_view message) noexcept
FMT_API void detail::do_report_error (format_func func, int error_code, const char *message) noexcept
void detail::fwrite_all (const void *ptr, size_t count, FILE *stream)
template<typename Char>
FMT_FUNC auto detail::thousands_sep_impl (locale_ref loc) -> thousands_sep_result< Char >
template<typename Char>
FMT_FUNC auto detail::decimal_point_impl (locale_ref loc) -> Char
FMT_FUNC void report_error (const char *message)
 Reports a format error at compile time or, via a format_error exception, at runtime.
FMT_FUNC auto vsystem_error (int error_code, string_view fmt, format_args args) -> std::system_error
template<typename F>
auto detail::operator== (basic_fp< F > x, basic_fp< F > y) -> bool
FMT_INLINE auto detail::rotr (uint32_t n, uint32_t r) noexcept -> uint32_t
FMT_INLINE auto detail::rotr (uint64_t n, uint32_t r) noexcept -> uint64_t
auto detail::dragonbox::umul96_upper64 (uint32_t x, uint64_t y) noexcept -> uint64_t
auto detail::dragonbox::umul192_lower128 (uint64_t x, uint128_fallback y) noexcept -> uint128_fallback
auto detail::dragonbox::umul96_lower64 (uint32_t x, uint64_t y) noexcept -> uint64_t
auto detail::dragonbox::floor_log10_pow2_minus_log10_4_over_3 (int e) noexcept -> int
template<int N>
auto detail::dragonbox::check_divisibility_and_divide_by_pow10 (uint32_t &n) noexcept -> bool
template<int N>
auto detail::dragonbox::small_division_by_pow10 (uint32_t n) noexcept -> uint32_t
auto detail::dragonbox::divide_by_10_to_kappa_plus_1 (uint32_t n) noexcept -> uint32_t
auto detail::dragonbox::divide_by_10_to_kappa_plus_1 (uint64_t n) noexcept -> uint64_t
FMT_API auto detail::dragonbox::get_cached_power (int k) noexcept -> uint128_fallback
template<typename T>
auto detail::dragonbox::is_left_endpoint_integer_shorter_interval (int exponent) noexcept -> bool
FMT_INLINE auto detail::dragonbox::remove_trailing_zeros (uint32_t &n, int s=0) noexcept -> int
FMT_INLINE auto detail::dragonbox::remove_trailing_zeros (uint64_t &n) noexcept -> int
template<typename T>
FMT_INLINE auto detail::dragonbox::shorter_interval_case (int exponent) noexcept -> decimal_fp< T >
template<typename T>
auto detail::dragonbox::to_decimal (T x) noexcept -> decimal_fp< T >
FMT_FUNC void format_system_error (detail::buffer< char > &out, int error_code, const char *message) noexcept
 Formats an error message for an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out.
FMT_FUNC void report_system_error (int error_code, const char *message) noexcept
FMT_FUNC auto vformat (string_view fmt, format_args args) -> std::string
FMT_FUNC void detail::vformat_to (buffer< char > &buf, string_view fmt, format_args args, locale_ref loc)
template<typename F>
auto detail::flockfile (F *f) -> decltype(_lock_file(f))
template<typename F>
auto detail::funlockfile (F *f) -> decltype(_unlock_file(f))
template<typename F>
auto detail::getc_unlocked (F *f) -> decltype(_fgetc_nolock(f))
template<typename F, FMT_ENABLE_IF(sizeof(F::_p) !=0 &&!FMT_USE_FALLBACK_FILE)>
auto detail::get_file (F *f, int) -> apple_file< F >
template<typename F, FMT_ENABLE_IF(sizeof(F::_IO_read_ptr) !=0 &&!FMT_USE_FALLBACK_FILE)>
auto detail::get_file (F *f, int) -> glibc_file< F >
auto detail::get_file (FILE *f,...) -> fallback_file< FILE >
FMT_API auto detail::write_console (int fd, string_view text) -> bool
FMT_FUNC void detail::print (std::FILE *f, string_view text)
FMT_FUNC void vprint_buffered (std::FILE *f, string_view fmt, format_args args)
FMT_FUNC void vprint (std::FILE *f, string_view fmt, format_args args)
FMT_FUNC void vprintln (std::FILE *f, string_view fmt, format_args args)
FMT_FUNC void vprint (string_view fmt, format_args args)
auto detail::is_printable (uint16_t x, const singleton *singletons, size_t singletons_size, const unsigned char *singleton_lowers, const unsigned char *normal, size_t normal_size) -> bool
FMT_API auto detail::is_printable (uint32_t cp) -> bool

Variables

template<typename Locale>
Locale::id format_facet< Locale >::id
FMT_INLINE_VARIABLE constexpr struct detail::dragonbox::div_small_pow10_infos_struct detail::dragonbox::div_small_pow10_infos [] = {{10, 16}, {100, 16}}

Macro Definition Documentation

◆ FMT_FUNC

#define FMT_FUNC

◆ FMT_USE_FALLBACK_FILE

#define FMT_USE_FALLBACK_FILE   0

Function Documentation

◆ assert_fail()

FMT_BEGIN_NAMESPACE FMT_FUNC void assert_fail ( const char * file,
int line,
const char * message )

◆ format_system_error()

FMT_FUNC void format_system_error ( detail::buffer< char > & out,
int error_code,
const char * message )
noexcept

Formats an error message for an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out.

The format is the same as the one used by std::system_error(ec, message) where ec is std::error_code(error_code, std::generic_category()). It is implementation-defined but normally looks like:

<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.

◆ report_error()

FMT_FUNC void report_error ( const char * message)

Reports a format error at compile time or, via a format_error exception, at runtime.

◆ report_system_error()

FMT_FUNC void report_system_error ( int error_code,
const char * message )
noexcept

◆ vformat()

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

◆ vprint() [1/2]

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

◆ vprint() [2/2]

FMT_FUNC void vprint ( string_view fmt,
format_args args )

◆ vprint_buffered()

FMT_FUNC void vprint_buffered ( std::FILE * f,
string_view fmt,
format_args args )

◆ vprintln()

FMT_FUNC void vprintln ( std::FILE * f,
string_view fmt,
format_args args )

◆ vsystem_error()

FMT_FUNC auto vsystem_error ( int error_code,
string_view fmt,
format_args args )->std::system_error

Variable Documentation

◆ format_facet< Locale >::id

template<typename Locale>
Locale::id format_facet< Locale >::id