BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslfmt::FormatterIntegralBase< t_VALUE, t_CHAR > Struct Template Reference

#include <bslfmt_formatterintegralbase.h>

Inheritance diagram for bslfmt::FormatterIntegralBase< t_VALUE, t_CHAR >:
bslfmt::FormatterCharacter_Imp< t_VALUE, t_CHAR > bslfmt::FormatterIntegral_Imp< t_VALUE, t_CHAR > bslfmt::FormatterPointer_Imp< t_VALUE, t_CHAR >

Detailed Description

template<class t_VALUE, class t_CHAR>
struct bslfmt::FormatterIntegralBase< t_VALUE, t_CHAR >

This struct is a base class for bsl::formatter specializations for integer types as well as for other types that can be represented as integer (i.e. bool, character and pointer types). This is a private class and should not be used directly. The formatting of variables of a certain type is performed using the corresponding classes inherited from this one. Accordingly, the auxiliary functions used are declared protected.

See bslfmt_formatterintegralbase

Public Member Functions

template<class t_PARSE_CONTEXT >
BSLS_KEYWORD_CONSTEXPR_CPP20 t_PARSE_CONTEXT::iterator parse (t_PARSE_CONTEXT &parseContext)
 
template<class t_ACTUAL_VALUE_TYPE >
char * formatPrefix (char *prefixStorage, int storageSize, t_ACTUAL_VALUE_TYPE value) const
 
template<class t_ACTUAL_VALUE_TYPE >
t_CHAR * formatValue (t_CHAR *valueStorage, int storageSize, t_ACTUAL_VALUE_TYPE value) const
 
template<class t_FORMAT_CONTEXT >
t_FORMAT_CONTEXT::iterator outputValue (const char *prefixBegin, const char *prefixEnd, const t_CHAR *valueBegin, const t_CHAR *valueEnd, t_FORMAT_CONTEXT &formatContext) const
 
const StandardFormatSpecification< t_CHAR > & specification () const
 

Member Function Documentation

◆ formatPrefix()

template<class t_VALUE , class t_CHAR >
template<class t_ACTUAL_VALUE_TYPE >
char * bslfmt::FormatterIntegralBase< t_VALUE, t_CHAR >::formatPrefix ( char *  prefixStorage,
int  storageSize,
t_ACTUAL_VALUE_TYPE  value 
) const
inline

Create the prefix for output of the specified value and write it into the character buffer starting a the specified prefixStorage and having the specified storageSize. Return the address one past the last character. Throw bsl::format_error if parsed format specification is intended for non-integer type.

◆ formatValue()

template<class t_VALUE , class t_CHAR >
template<class t_ACTUAL_VALUE_TYPE >
t_CHAR * bslfmt::FormatterIntegralBase< t_VALUE, t_CHAR >::formatValue ( t_CHAR *  valueStorage,
int  storageSize,
t_ACTUAL_VALUE_TYPE  value 
) const
inline

Create the string representation of the specified value and write it into the character buffer starting at the specified valueStorage and having the specified storageSize. Return the address one past the last character. Throw bsl::format_error if parsed format specification is intended for non-integer type or the value is not in the range of representable values for the (template parameter) t_CHAR with character type specification.

◆ outputValue()

template<class t_VALUE , class t_CHAR >
template<class t_FORMAT_CONTEXT >
t_FORMAT_CONTEXT::iterator bslfmt::FormatterIntegralBase< t_VALUE, t_CHAR >::outputValue ( const char *  prefixBegin,
const char *  prefixEnd,
const t_CHAR *  valueBegin,
const t_CHAR *  valueEnd,
t_FORMAT_CONTEXT &  formatContext 
) const
inline

Copy the prefix of value string representation starting at the specified prefixBegin and ending at the specified prefixEnd as well as representation itself starting at the specified valueBegin and ending at the specified valueEnd to the output that the output iterator of the formatContext points to. Throw bsl::format_error if parsed format specification states incorrect alignment type.

◆ parse()

template<class t_VALUE , class t_CHAR >
template<class t_PARSE_CONTEXT >
BSLS_KEYWORD_CONSTEXPR_CPP20 t_PARSE_CONTEXT::iterator bslfmt::FormatterIntegralBase< t_VALUE, t_CHAR >::parse ( t_PARSE_CONTEXT &  parseContext)
inline

Parse the specified parseContext and return an iterator, pointing to the beginning of the format string.

◆ specification()

template<class t_VALUE , class t_CHAR >
const StandardFormatSpecification< t_CHAR > & bslfmt::FormatterIntegralBase< t_VALUE, t_CHAR >::specification ( ) const
inline

Return a reference to the specification of this formatter.


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