SoPlex Documentation
Loading...
Searching...
No Matches
format-inl.h File Reference
#include "format.h"
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdarg>
#include <cstring>
#include <cwchar>
#include <locale>

Go to the source code of this file.

Classes

struct  bits< T >
 
struct  boundaries
 
class  fp
 
struct  accumulator
 
class  bigint
 
struct  fixed_handler
 
struct  grisu_shortest_handler
 
struct  formatter< internal::bigint >
 

Namespaces

namespace  internal
 
namespace  internal::digits
 

Macros

#define FMT_TRY   if (true)
 
#define FMT_CATCH(x)   if (false)
 
#define FMT_SNPRINTF   snprintf
 
#define FMT_POWERS_OF_10(factor)
 

Typedefs

using format_func = void (*)(internal::buffer<char>&, int, string_view)
 

Enumerations

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

Functions

fmt::internal::null strerror_r (int, char *,...)
 
fmt::internal::null strerror_s (char *, std::size_t,...)
 
FMT_API void assert_fail (const char *file, int line, const char *message)
 
FMT_FUNC int safe_strerror (int error_code, char *&buffer, std::size_t buffer_size) FMT_NOEXCEPT
 
FMT_FUNC void format_error_code (internal::buffer< char > &out, int error_code, string_view message) FMT_NOEXCEPT
 
FMT_FUNC void fwrite_fully (const void *ptr, size_t size, size_t count, FILE *stream)
 
FMT_FUNC void report_error (format_func func, int error_code, string_view message) FMT_NOEXCEPT
 
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 > (internal::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)
 
FMT_FUNC 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)
 
template<typename Double >
void fallback_format (Double d, 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)
 
FMT_FUNC void format_system_error (internal::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_CATCH

#define FMT_CATCH ( x)    if (false)

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

Referenced by format_system_error().

◆ 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 263 of file format-inl.h.

◆ FMT_SNPRINTF

#define FMT_SNPRINTF   snprintf

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

Referenced by internal::snprintf_float().

◆ FMT_TRY

#define FMT_TRY   if (true)

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

Referenced by format_system_error().

Function Documentation

◆ format_system_error()

FMT_FUNC void format_system_error ( internal::buffer< char > & out,
int error_code,
string_view message )

\rst 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. \endrst

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

References FMT_CATCH, FMT_TRY, inline_buffer_size, buffer< T >::resize(), internal::safe_strerror(), buffer< T >::size(), and basic_writer< Range >::write().

Referenced by 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 1367 of file format-inl.h.

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

◆ strerror_r()

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

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

Referenced by internal::safe_strerror().

◆ strerror_s()

fmt::internal::null strerror_s ( char * ,
std::size_t ,
... )

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

Referenced by internal::safe_strerror().

◆ vprint() [1/2]

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

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

References buffer< T >::data(), internal::fwrite_fully(), buffer< T >::size(), and internal::vformat_to().

Referenced by print(), and print().

◆ vprint() [2/2]

FMT_FUNC void vprint ( string_view format_str,
format_args args )

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

References vprint().