Scippy

SoPlex

Sequential object-oriented simPlex

format-inl.h File Reference
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdarg>
#include <cstring>
#include <cwchar>
#include <exception>
#include <locale>
#include "format.h"

Go to the source code of this file.

Classes

struct  bits< T >
 
struct  boundaries
 
class  fp
 
struct  accumulator
 
class  bigint
 
struct  fixed_handler
 
struct  cache_accessor< T >
 
struct  cache_accessor< float >
 
struct  cache_accessor< double >
 
struct  stringifier
 
struct  formatter< detail::bigint >
 

Namespaces

 detail
 
 detail::digits
 
 detail::dragonbox
 

Macros

#define FMT_SNPRINTF   snprintf
 
#define FMT_POWERS_OF_10(factor)
 

Enumerations

enum  round_direction { unknown, up, down }
 
enum  result { more, done, error }
 

Functions

fmt::detail::null strerror_r (int, char *,...)
 
fmt::detail::null strerror_s (char *, size_t,...)
 
FMT_NORETURN FMT_API void assert_fail (const char *file, int line, const char *message)
 
int safe_strerror (int error_code, char *&buffer, size_t buffer_size) FMT_NOEXCEPT
 
FMT_FUNC void format_error_code (detail::buffer< char > &out, int error_code, string_view message) FMT_NOEXCEPT
 
FMT_FUNC void report_error (format_func func, int error_code, string_view message) FMT_NOEXCEPT
 
void fwrite_fully (const void *ptr, size_t size, size_t count, FILE *stream)
 
template<typename Char >
FMT_FUNC std::string grouping_impl (locale_ref loc)
 
template<typename Char >
FMT_FUNC Char thousands_sep_impl (locale_ref loc)
 
template<typename Char >
FMT_FUNC Char decimal_point_impl (locale_ref loc)
 
template<>
FMT_FUNC int count_digits< 4 > (detail::fallback_uintptr n)
 
template<int SHIFT = 0>
fp normalize (fp value)
 
bool operator== (fp x, fp y)
 
uint64_t multiply (uint64_t lhs, uint64_t rhs)
 
fp operator* (fp x, fp y)
 
fp get_cached_power (int min_exponent, int &pow10_exponent)
 
round_direction get_round_direction (uint64_t divisor, uint64_t remainder, uint64_t error)
 
template<typename Handler >
FMT_ALWAYS_INLINE digits::result grisu_gen_digits (fp value, uint64_t error, int &exp, Handler &handler)
 
FMT_SAFEBUFFERS uint128_wrapper umul128 (uint64_t x, uint64_t y) FMT_NOEXCEPT
 
FMT_SAFEBUFFERS uint64_t umul128_upper64 (uint64_t x, uint64_t y) FMT_NOEXCEPT
 
FMT_SAFEBUFFERS uint64_t umul192_upper64 (uint64_t x, uint128_wrapper y) FMT_NOEXCEPT
 
uint32_t umul96_upper32 (uint32_t x, uint64_t y) FMT_NOEXCEPT
 
FMT_SAFEBUFFERS uint64_t umul192_middle64 (uint64_t x, uint128_wrapper y) FMT_NOEXCEPT
 
uint64_t umul96_lower64 (uint32_t x, uint64_t y) FMT_NOEXCEPT
 
int floor_log10_pow2 (int e) FMT_NOEXCEPT
 
int floor_log2_pow10 (int e) FMT_NOEXCEPT
 
int floor_log10_pow2_minus_log10_4_over_3 (int e) FMT_NOEXCEPT
 
bool divisible_by_power_of_2 (uint32_t x, int exp) FMT_NOEXCEPT
 
bool divisible_by_power_of_2 (uint64_t x, int exp) FMT_NOEXCEPT
 
bool divisible_by_power_of_5 (uint32_t x, int exp) FMT_NOEXCEPT
 
bool divisible_by_power_of_5 (uint64_t x, int exp) FMT_NOEXCEPT
 
template<int N>
bool check_divisibility_and_divide_by_pow5 (uint32_t &n) FMT_NOEXCEPT
 
template<int N>
uint32_t small_division_by_pow10 (uint32_t n) FMT_NOEXCEPT
 
uint32_t divide_by_10_to_kappa_plus_1 (uint32_t n) FMT_NOEXCEPT
 
uint64_t divide_by_10_to_kappa_plus_1 (uint64_t n) FMT_NOEXCEPT
 
template<class T >
bool is_left_endpoint_integer_shorter_interval (int exponent) FMT_NOEXCEPT
 
template<class T >
bool is_endpoint_integer (typename float_info< T >::carrier_uint two_f, int exponent, int minus_k) FMT_NOEXCEPT
 
template<class T >
bool is_center_integer (typename float_info< T >::carrier_uint two_f, int exponent, int minus_k) FMT_NOEXCEPT
 
FMT_ALWAYS_INLINE int remove_trailing_zeros (uint32_t &n) FMT_NOEXCEPT
 
FMT_ALWAYS_INLINE int remove_trailing_zeros (uint64_t &n) FMT_NOEXCEPT
 
template<class T >
FMT_ALWAYS_INLINE FMT_SAFEBUFFERS decimal_fp< T > shorter_interval_case (int exponent) FMT_NOEXCEPT
 
template<typename T >
FMT_SAFEBUFFERS decimal_fp< T > to_decimal (T x) FMT_NOEXCEPT
 
template<typename Double >
void fallback_format (Double d, int num_digits, bool binary32, buffer< char > &buf, int &exp10)
 
template<typename T >
int format_float (T value, int precision, float_specs specs, buffer< char > &buf)
 
template<typename T >
int snprintf_float (T value, int precision, float_specs specs, buffer< char > &buf)
 
const char * utf8_decode (const char *buf, uint32_t *c, int *e)
 
FMT_FUNC void format_system_error (detail::buffer< char > &out, int error_code, string_view message) FMT_NOEXCEPT
 
FMT_FUNC void report_system_error (int error_code, fmt::string_view message) FMT_NOEXCEPT
 
FMT_FUNC void vprint (std::FILE *f, string_view format_str, format_args args)
 
FMT_FUNC void vprint (string_view format_str, format_args args)
 

Macro Definition Documentation

◆ FMT_POWERS_OF_10

#define FMT_POWERS_OF_10 (   factor)
Value:
factor * 10, (factor)*100, (factor)*1000, (factor)*10000, (factor)*100000, \
(factor)*1000000, (factor)*10000000, (factor)*100000000, \
(factor)*1000000000

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

◆ FMT_SNPRINTF

#define FMT_SNPRINTF   snprintf

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

Referenced by detail::snprintf_float().

Function Documentation

◆ format_system_error()

FMT_FUNC void format_system_error ( detail::buffer< char > &  out,
int  error_code,
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 2713 of file format-inl.h.

References FMT_CATCH, FMT_TRY, detail::format_error_code(), format_to(), inline_buffer_size, basic_memory_buffer< T, SIZE, Allocator >::resize(), detail::safe_strerror(), and buffer< T >::size().

Referenced by system_error::error_code(), system_error::init(), and report_system_error().

◆ report_system_error()

FMT_FUNC void report_system_error ( int  error_code,
fmt::string_view  message 
)

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

References format_system_error(), and detail::report_error().

◆ strerror_r()

fmt::detail::null strerror_r ( int  ,
char *  ,
  ... 
)

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

Referenced by detail::safe_strerror().

◆ strerror_s()

fmt::detail::null strerror_s ( char *  ,
size_t  ,
  ... 
)

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

References FMT_BEGIN_NAMESPACE.

Referenced by detail::safe_strerror().

◆ vprint() [1/2]

◆ vprint() [2/2]

FMT_FUNC void vprint ( string_view  format_str,
format_args  args 
)

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

References FMT_END_NAMESPACE, and vprint().

Referenced by format(), and print().