fiber
Loading...
Searching...
No Matches
fiber::FormatIntSuffix< Int > Struct Template Reference

#include <OStream.hpp>

Inheritance diagram for fiber::FormatIntSuffix< Int >:
fiber::FormatIntSuffixParams fiber::FormatIntParams fiber::FormatStrParams fiber::_FormatUIntParams

Public Types

using value_type = typename fiber::make_fast<Int>::type
 

Public Member Functions

constexpr FormatIntSuffix ()=default
 
constexpr FormatIntSuffix (const FormatIntSuffix &)=default
 
constexpr FormatIntSuffixoperator= (const FormatIntSuffix &)=default
 
constexpr FormatIntSuffix (Int value, std::string_view suffix)
 
constexpr FormatIntSuffixpad_suffix (bool b=true)
 adds padding between the number and the suffix
 
constexpr FormatIntSuffixuse_thousands (bool b=true)
 enables thousand characters
 
constexpr FormatIntSuffixthousands (char c=',')
 enables thousand characters
 
constexpr FormatIntSuffixfsign (bool b=true)
 force the printing of the sign, even if it is positive.
 
constexpr FormatIntSuffixmwidth (int mw)
 
constexpr FormatIntSuffixfill (char c)
 
constexpr FormatIntSuffixpad_sign (bool b=true)
 
constexpr FormatIntSuffixleft ()
 
constexpr FormatIntSuffixright ()
 
constexpr FormatIntSuffixcenter ()
 
- Public Member Functions inherited from fiber::FormatIntSuffixParams
constexpr FormatIntSuffixParams ()=default
 
constexpr FormatIntSuffixParams (const FormatIntSuffixParams &)=default
 
constexpr FormatIntSuffixParamsoperator= (const FormatIntSuffixParams &)=default
 
constexpr FormatIntSuffixParams (const FormatStrParams &params)
 
constexpr FormatIntSuffixParamsoperator= (const FormatStrParams &params)
 
constexpr FormatIntSuffixParams (const FormatIntParams &params)
 
constexpr FormatIntSuffixParamsoperator= (const FormatIntParams &params)
 
- Public Member Functions inherited from fiber::FormatIntParams
constexpr FormatIntParams ()=default
 
constexpr FormatIntParams (const FormatIntParams &)=default
 
constexpr FormatIntParamsoperator= (const FormatIntParams &)=default
 
constexpr FormatIntParams (const FormatStrParams &params)
 
constexpr FormatIntParamsoperator= (const FormatStrParams &params)
 

Static Public Member Functions

static constexpr FormatIntSuffix like (Int value, std::string_view suffix, const FormatIntParams &params)
 
static constexpr FormatIntSuffix like (Int value, std::string_view suffix, const FormatStrParams &params)
 
static constexpr FormatIntSuffix like (Int value, std::string_view suffix, const FormatIntSuffixParams &params)
 

Public Attributes

value_type _value = 0
 
std::string_view _suffix = ""
 
- Public Attributes inherited from fiber::FormatIntSuffixParams
bool _pad_suffix = false
 
- Public Attributes inherited from fiber::FormatIntParams
bool _force_sign = false
 
bool _pad_sign = false
 
- Public Attributes inherited from fiber::FormatStrParams
AlignmentLRC _alignment = AlignmentLRC::Right
 
int _mwidth = 0
 
char _fill = ' '
 
- Public Attributes inherited from fiber::_FormatUIntParams
char _thousands_char = ','
 
bool _use_thousands = false
 

Member Typedef Documentation

◆ value_type

template<std::integral Int>
using fiber::FormatIntSuffix< Int >::value_type = typename fiber::make_fast<Int>::type

Constructor & Destructor Documentation

◆ FormatIntSuffix() [1/3]

template<std::integral Int>
fiber::FormatIntSuffix< Int >::FormatIntSuffix ( )
constexprdefault

◆ FormatIntSuffix() [2/3]

template<std::integral Int>
fiber::FormatIntSuffix< Int >::FormatIntSuffix ( const FormatIntSuffix< Int > & )
constexprdefault

◆ FormatIntSuffix() [3/3]

template<std::integral Int>
fiber::FormatIntSuffix< Int >::FormatIntSuffix ( Int value,
std::string_view suffix )
inlineconstexpr

Member Function Documentation

◆ center()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::center ( )
inlineconstexpr

◆ fill()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::fill ( char c)
inlineconstexpr

◆ fsign()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::fsign ( bool b = true)
inlineconstexpr

force the printing of the sign, even if it is positive.

◆ left()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::left ( )
inlineconstexpr

◆ like() [1/3]

template<std::integral Int>
static constexpr FormatIntSuffix fiber::FormatIntSuffix< Int >::like ( Int value,
std::string_view suffix,
const FormatIntParams & params )
inlinestaticconstexpr

◆ like() [2/3]

template<std::integral Int>
static constexpr FormatIntSuffix fiber::FormatIntSuffix< Int >::like ( Int value,
std::string_view suffix,
const FormatIntSuffixParams & params )
inlinestaticconstexpr

◆ like() [3/3]

template<std::integral Int>
static constexpr FormatIntSuffix fiber::FormatIntSuffix< Int >::like ( Int value,
std::string_view suffix,
const FormatStrParams & params )
inlinestaticconstexpr

◆ mwidth()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::mwidth ( int mw)
inlineconstexpr

◆ operator=()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::operator= ( const FormatIntSuffix< Int > & )
constexprdefault

◆ pad_sign()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::pad_sign ( bool b = true)
inlineconstexpr

◆ pad_suffix()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::pad_suffix ( bool b = true)
inlineconstexpr

adds padding between the number and the suffix

◆ right()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::right ( )
inlineconstexpr

◆ thousands()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::thousands ( char c = ',')
inlineconstexpr

enables thousand characters

Example:

stream << FormatIntSuffix(4203).thousands('.'); //Outputs 4.203
stream << FormatIntSuffix(4203).thousands(','); //Outputs 4,203
constexpr FormatIntSuffix()=default

◆ use_thousands()

template<std::integral Int>
FormatIntSuffix & fiber::FormatIntSuffix< Int >::use_thousands ( bool b = true)
inlineconstexpr

enables thousand characters

Example:

stream << FormatIntSuffix(4203).use_thousands(); //Outputs 4,203
stream << FormatIntSuffix(4203).use_thousands(true); //Outputs 4,203
stream << FormatIntSuffix(4203).use_thousands(false); //Outputs 4203

Member Data Documentation

◆ _suffix

template<std::integral Int>
std::string_view fiber::FormatIntSuffix< Int >::_suffix = ""

◆ _value

template<std::integral Int>
value_type fiber::FormatIntSuffix< Int >::_value = 0

The documentation for this struct was generated from the following file: