|
BDE 4.39.x Production Release
|
#include <bslfmt_padutil.h>
This struct serves as a namespace for static functions related to padding output by bslfmt.
See bslfmt_padutil
Public Types | |
| typedef FormatterSpecificationNumericValue | NumericValue |
| typedef FormatSpecificationParserEnums | Enums |
| typedef Enums::Alignment | Alignment |
Public Member Functions | |
| BSLMF_ASSERT ((bsl::is_same< t_CHAR, char >::value||bsl::is_same< t_CHAR, wchar_t >::value)) | |
Static Public Member Functions | |
| static void | computePadding (std::ptrdiff_t *leftPadding, std::ptrdiff_t *rightPadding, const NumericValue &widthValue, std::ptrdiff_t contentWidth, Alignment alignment, Alignment defaultAlign=Enums::e_ALIGN_LEFT) |
| template<class t_ITERATOR > | |
| static t_ITERATOR | pad (t_ITERATOR out, std::ptrdiff_t padWidth, const bsl::string_view &filler) |
| template<class t_ITERATOR > | |
| static t_ITERATOR | pad (t_ITERATOR out, std::ptrdiff_t padWidth, const bsl::wstring_view &filler) |
| template<class t_ITERATOR > | |
| static t_ITERATOR | pad (t_ITERATOR out, std::ptrdiff_t padWidth, char filler) |
| template<class t_ITERATOR > | |
| static t_ITERATOR | pad (t_ITERATOR out, std::ptrdiff_t padWidth, wchar_t filler) |
| typedef Enums::Alignment bslfmt::PadUtil< t_CHAR >::Alignment |
| typedef FormatSpecificationParserEnums bslfmt::PadUtil< t_CHAR >::Enums |
| typedef FormatterSpecificationNumericValue bslfmt::PadUtil< t_CHAR >::NumericValue |
| bslfmt::PadUtil< t_CHAR >::BSLMF_ASSERT | ( | (bsl::is_same< t_CHAR, char >::value||bsl::is_same< t_CHAR, wchar_t >::value) | ) |
|
static |
Compute the left and right padding values needed to format content with the specified contentWidth within a field of the width specified by widthValue using the specified alignment. If Enums::e_ALIGN_DEFAULT is passed to alignment, use the specified defaultAlign instead. Load the computed padding values into the specified leftPadding and rightPadding. If the category of widthValue is not e_VALUE or if the value indicated by widthValue is less than contentWidth, the padding is zero.
contentWidth specifies a negative width, or if defaultAlign specifies e_ALIGN_DEFAULT.
|
inlinestatic |
|
static |
Write the specified filler (possibly a multi-byte unicode sequence) to the specified out the specified padWidth times and return the new output iterator. If padWidth < 0, no output is done.
filler is the same as t_CHAR or filler is entirely ascii. bsl::fill_n in that they will automatically widen or narrow the input character to t_CHAR if necessary.
|
static |
|
inlinestatic |