fiber
Loading...
Searching...
No Matches
fiber::FormatHex< UInt > Struct Template Reference

#include <OStream.hpp>

Inheritance diagram for fiber::FormatHex< UInt >:
fiber::FormatStrParams fiber::FormatHexParams

Public Member Functions

 FormatHex (const UInt &v)
 
constexpr FormatHex & head ()
 enable the hex header '0x' in the beginning.
 
constexpr FormatHex & nohead ()
 disable the hex header '0x' in the beginning.
 
constexpr FormatHex & lead ()
 enable leading zeros of the hex number
 
constexpr FormatHex & nolead ()
 disables leading zeros of the hex number
 
constexpr FormatHex & lower ()
 use lower case letters for the hex number
 
constexpr FormatHex & upper ()
 use uppercase letters for hex numbers
 
constexpr FormatHex & mwidth (int mw)
 Sets the minimum number of character that will be put into the stream.
 
constexpr FormatHex & left ()
 Formats the string to the left area set by mwidth().
 
constexpr FormatHex & right ()
 Formats the string to the left area set by mwidth().
 
constexpr FormatHex & center ()
 Formats the string to the left area set by mwidth().
 
constexpr FormatHex & fill (char c)
 Sets the fill characters used by padding that is applied when mwidth() is used.
 

Public Attributes

UInt _value
 
- Public Attributes inherited from fiber::FormatStrParams
AlignmentLRC _alignment = AlignmentLRC::Right
 
int _mwidth = 0
 
char _fill = ' '
 
- Public Attributes inherited from fiber::FormatHexParams
bool include_header = true
 
bool force_digits = true
 
bool lowercase = true
 

Constructor & Destructor Documentation

◆ FormatHex()

template<std::unsigned_integral UInt>
fiber::FormatHex< UInt >::FormatHex ( const UInt & v)
inline

Member Function Documentation

◆ center()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::center ( )
inlineconstexpr

Formats the string to the left area set by mwidth().

Example:

stream << "[" << FormatStr("OK").mwidth(6).center() << "]" << endl; // Outputs: [ OK ]
void endl(OStream &stream)
Writes a new line character to the stream followed by a call to OStream::flush()
Definition OStream.hpp:198
Formats a string and allows to pass an additional size parameter.
Definition OStream.hpp:261
constexpr FormatStr & mwidth(int mw)
Sets the minimum number of character that will be put into the stream.
Definition OStream.hpp:387
constexpr FormatStr & center()
Formats the string to the left area set by mwidth().
Definition OStream.hpp:423
Returns
self

◆ fill()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::fill ( char c)
inlineconstexpr

Sets the fill characters used by padding that is applied when mwidth() is used.

Parameters
cThe new fill character
Returns
self

◆ head()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::head ( )
inlineconstexpr

enable the hex header '0x' in the beginning.

◆ lead()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::lead ( )
inlineconstexpr

enable leading zeros of the hex number

◆ left()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::left ( )
inlineconstexpr

Formats the string to the left area set by mwidth().

Example:

stream << "[" << FormatStr("OK").mwidth(6).left() << "]" << endl; // Outputs: [OK ]
constexpr FormatStr & left()
Formats the string to the left area set by mwidth().
Definition OStream.hpp:399
Returns
self

◆ lower()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::lower ( )
inlineconstexpr

use lower case letters for the hex number

◆ mwidth()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::mwidth ( int mw)
inlineconstexpr

Sets the minimum number of character that will be put into the stream.

Padded characters are defined by FormatStr::fill(char c). The default fill character is a space ' '.

Example:

stream << "[" << FormatStr("OK").mwidth(6) << "]" << endl; // Outputs: [ OK]
Parameters
mwAn integer that sets the new minimal width
Returns
self

◆ nohead()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::nohead ( )
inlineconstexpr

disable the hex header '0x' in the beginning.

◆ nolead()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::nolead ( )
inlineconstexpr

disables leading zeros of the hex number

◆ right()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::right ( )
inlineconstexpr

Formats the string to the left area set by mwidth().

Example:

stream << "[" << FormatStr("OK").mwidth(6).right() << "]" << endl; // Outputs: [ OK]
constexpr FormatStr & right()
Formats the string to the left area set by mwidth().
Definition OStream.hpp:411
Returns
self

◆ upper()

template<std::unsigned_integral UInt>
FormatHex & fiber::FormatHex< UInt >::upper ( )
inlineconstexpr

use uppercase letters for hex numbers

Member Data Documentation

◆ _value

template<std::unsigned_integral UInt>
UInt fiber::FormatHex< UInt >::_value

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