AsHex< Integer > Class Template Reference

#include <IoManip.h>

Collaboration diagram for AsHex< Integer >:

Public Member Functions

 AsHex (const Integer n)
 
auto & minDigits (const size_t w)
 
auto & upperCase (const bool u=true)
 Print hex digits in upper (or, with a false parameter value, lower) case. More...
 

Public Attributes

Integer io_manip
 the integer to print More...
 
std::optional< size_tforcePadding
 
std::optional< bool > forceCase
 Print hex digits in upper (or, with a false parameter value, lower) case. More...
 

Detailed Description

template<class Integer>
class AsHex< Integer >

std::ostream manipulator to print integers and alike as hex numbers. Normally used through the asHex() convenience function.

Definition at line 111 of file IoManip.h.

Constructor & Destructor Documentation

◆ AsHex()

template<class Integer >
AsHex< Integer >::AsHex ( const Integer  n)
inlineexplicit

Definition at line 120 of file IoManip.h.

Member Function Documentation

◆ minDigits()

template<class Integer >
auto& AsHex< Integer >::minDigits ( const size_t  w)
inline

Sets the minimum number of digits to print. If the integer has fewer digits than the given width, then we also print leading zero(s). Otherwise, this method has no effect.

Definition at line 125 of file IoManip.h.

References AsHex< Integer >::forcePadding.

◆ upperCase()

template<class Integer >
auto& AsHex< Integer >::upperCase ( const bool  u = true)
inline

Definition at line 128 of file IoManip.h.

References AsHex< Integer >::forceCase.

Member Data Documentation

◆ forceCase

template<class Integer >
std::optional<bool> AsHex< Integer >::forceCase

The default is to use stream's std::uppercase flag.

Definition at line 138 of file IoManip.h.

Referenced by AsHex< Integer >::upperCase().

◆ forcePadding

template<class Integer >
std::optional<size_t> AsHex< Integer >::forcePadding

Sets the minimum number of digits to print. If the integer has fewer digits than the given width, then we also print leading zero(s). Otherwise, this method has no effect. The default is to use stream's field width and stream's fill character.

Definition at line 134 of file IoManip.h.

Referenced by AsHex< Integer >::minDigits().

◆ io_manip

template<class Integer >
Integer AsHex< Integer >::io_manip

Definition at line 130 of file IoManip.h.


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

 

Introduction

Documentation

Support

Miscellaneous