jaulib v1.4.1-17-gd77ace3-dirty
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
jau::cfmt::impl Namespace Reference

Classes

class  FResult
 
class  no_type_t
 
class  NullOutput
 A null OutputType for constexpr and consteval formatting dropping all output. More...
 
class  Parser
 
class  StringOutput
 A std::string OutputType for runtime formatting into a std::string. More...
 

Concepts

concept  OutputType
 

Typedefs

typedef Parser< NullOutputCheckParser
 
typedef FResult< NullOutputCheckResult
 
typedef Parser< StringOutputFormatParser
 
template<typename T>
using make_int_signed_t = typename std::conditional_t<jau::req::unsigned_integral<T> && !jau::req::boolean<T>, std::make_signed<T>, std::type_identity<T>>::type
 Returns signed-type variation if: unsigned-integral && !boolean, otherwise returns orig type.
 
template<typename T>
using make_int_unsigned_t = typename std::conditional_t<std::is_integral_v<T> || jau::req::boolean<T>, std::type_identity<uint64_t>, std::type_identity<T>>::type
 Returns uint64_t type if: integral || boolean, otherwise returns orig type.
 
template<typename T>
using make_simple_pointer_t = typename std::conditional_t<jau::req::pointer<T>, std::type_identity<const char * const>, std::type_identity<T>>::type
 Returns a simple const char * const if: pointer, otherwise returns orig type.
 
typedef FResult< StringOutputStringResult
 A StringOutput formatting result for runtime formatting into a std::string.
 

Functions

template<typename T>
requires (!jau::req::signed_integral<T>)
constexpr T abs_int (const T &x) noexcept
 
template<jau::req::signed_integral T>
constexpr T abs_int (const T x) noexcept
 
void append_afloatF64 (std::string &dest, const size_t dest_maxlen, const double ivalue, const size_t ivalue_size, const FormatOpts &iopts)
 
void append_efloatF64 (std::string &dest, const size_t dest_maxlen, const double ivalue, const FormatOpts &iopts)
 
void append_floatF64 (std::string &dest, const size_t dest_maxlen, const double value, const FormatOpts &opts)
 
void append_integral (std::string &dest, const size_t dest_maxlen, uint64_t v, const bool negative, const FormatOpts &opts, const bool inject_dot=false)
 
void append_rev (std::string &dest, const size_t dest_maxlen, std::string_view src, bool prec_cut, bool reverse, const FormatOpts &opts)
 
void append_string (std::string &dest, const size_t dest_maxlen, std::string_view src, const FormatOpts &opts)
 
bool is_float_validF64 (std::string &dest, const size_t dest_maxlen, const double value, const FormatOpts &opts)
 
template<std::floating_point value_type>
requires (!std::is_same_v<double, value_type>)
bool is_float_validT (std::string &dest, const size_t dest_maxlen, const value_type value, const FormatOpts &opts) noexcept
 
template<typename T>
requires (!jau::req::signed_integral<T>) && (!std::floating_point<T>)
constexpr bool is_positive (const T &) noexcept
 
template<typename T>
requires jau::req::signed_integral<T>
constexpr bool is_positive (const T a) noexcept
 
template<typename T>
requires std::floating_point<T>
constexpr bool is_positive (const T a) noexcept
 

Variables

constexpr const size_t char32buf_maxlen = 32
 
constexpr const size_t default_float_precision = 6
 
constexpr const double_t max_append_float = (double_t)1e9
 

Typedef Documentation

◆ make_int_unsigned_t

template<typename T>
using jau::cfmt::impl::make_int_unsigned_t = typename std::conditional_t<std::is_integral_v<T> || jau::req::boolean<T>, std::type_identity<uint64_t>, std::type_identity<T>>::type

Returns uint64_t type if: integral || boolean, otherwise returns orig type.

Definition at line 798 of file string_cfmt.hpp.

◆ make_int_signed_t

template<typename T>
using jau::cfmt::impl::make_int_signed_t = typename std::conditional_t<jau::req::unsigned_integral<T> && !jau::req::boolean<T>, std::make_signed<T>, std::type_identity<T>>::type

Returns signed-type variation if: unsigned-integral && !boolean, otherwise returns orig type.

Definition at line 802 of file string_cfmt.hpp.

◆ make_simple_pointer_t

template<typename T>
using jau::cfmt::impl::make_simple_pointer_t = typename std::conditional_t<jau::req::pointer<T>, std::type_identity<const char * const>, std::type_identity<T>>::type

Returns a simple const char * const if: pointer, otherwise returns orig type.

Definition at line 806 of file string_cfmt.hpp.

◆ CheckResult

Definition at line 809 of file string_cfmt.hpp.

◆ StringResult

A StringOutput formatting result for runtime formatting into a std::string.

Definition at line 812 of file string_cfmt.hpp.

◆ CheckParser

Definition at line 1505 of file string_cfmt.hpp.

◆ FormatParser

Function Documentation

◆ append_rev()

void jau::cfmt::impl::append_rev ( std::string & dest,
const size_t dest_maxlen,
std::string_view src,
bool prec_cut,
bool reverse,
const FormatOpts & opts )

Definition at line 1234 of file basic_types.cpp.

Here is the caller graph for this function:

◆ append_string()

void jau::cfmt::impl::append_string ( std::string & dest,
const size_t dest_maxlen,
std::string_view src,
const FormatOpts & opts )
inline

Definition at line 472 of file string_cfmt.hpp.

Here is the caller graph for this function:

◆ append_integral()

void jau::cfmt::impl::append_integral ( std::string & dest,
const size_t dest_maxlen,
uint64_t v,
const bool negative,
const FormatOpts & opts,
const bool inject_dot = false )

Definition at line 1287 of file basic_types.cpp.

Here is the caller graph for this function:

◆ is_float_validT()

template<std::floating_point value_type>
requires (!std::is_same_v<double, value_type>)
bool jau::cfmt::impl::is_float_validT ( std::string & dest,
const size_t dest_maxlen,
const value_type value,
const FormatOpts & opts )
noexcept

Definition at line 480 of file string_cfmt.hpp.

◆ is_float_validF64()

bool jau::cfmt::impl::is_float_validF64 ( std::string & dest,
const size_t dest_maxlen,
const double value,
const FormatOpts & opts )

Definition at line 1510 of file basic_types.cpp.

Here is the caller graph for this function:

◆ append_floatF64()

void jau::cfmt::impl::append_floatF64 ( std::string & dest,
const size_t dest_maxlen,
const double value,
const FormatOpts & opts )

Definition at line 1527 of file basic_types.cpp.

Here is the caller graph for this function:

◆ append_efloatF64()

void jau::cfmt::impl::append_efloatF64 ( std::string & dest,
const size_t dest_maxlen,
const double ivalue,
const FormatOpts & iopts )

Definition at line 1652 of file basic_types.cpp.

Here is the caller graph for this function:

◆ append_afloatF64()

void jau::cfmt::impl::append_afloatF64 ( std::string & dest,
const size_t dest_maxlen,
const double ivalue,
const size_t ivalue_size,
const FormatOpts & iopts )

Definition at line 1809 of file basic_types.cpp.

Here is the caller graph for this function:

◆ abs_int() [1/2]

T jau::cfmt::impl::abs_int ( const T x)
constexprnoexcept

Definition at line 767 of file string_cfmt.hpp.

Here is the caller graph for this function:

◆ abs_int() [2/2]

template<typename T>
requires (!jau::req::signed_integral<T>)
T jau::cfmt::impl::abs_int ( const T & x)
constexprnoexcept

Definition at line 774 of file string_cfmt.hpp.

◆ is_positive() [1/3]

template<typename T>
requires jau::req::signed_integral<T>
bool jau::cfmt::impl::is_positive ( const T a)
constexprnoexcept

Definition at line 780 of file string_cfmt.hpp.

Here is the caller graph for this function:

◆ is_positive() [2/3]

template<typename T>
requires std::floating_point<T>
bool jau::cfmt::impl::is_positive ( const T a)
constexprnoexcept

Definition at line 786 of file string_cfmt.hpp.

◆ is_positive() [3/3]

template<typename T>
requires (!jau::req::signed_integral<T>) && (!std::floating_point<T>)
bool jau::cfmt::impl::is_positive ( const T & )
constexprnoexcept

Definition at line 792 of file string_cfmt.hpp.

Variable Documentation

◆ char32buf_maxlen

const size_t jau::cfmt::impl::char32buf_maxlen = 32
inlineconstexpr

Definition at line 467 of file string_cfmt.hpp.

◆ default_float_precision

const size_t jau::cfmt::impl::default_float_precision = 6
inlineconstexpr

Definition at line 468 of file string_cfmt.hpp.

◆ max_append_float

const double_t jau::cfmt::impl::max_append_float = (double_t)1e9
inlineconstexpr

Definition at line 469 of file string_cfmt.hpp.