BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslfmt::FormatterSpecificationNumericValue_ArgVisitor Class Reference

#include <bslfmt_formatterspecificationnumericvalue.h>

Detailed Description

Component-private type to enable extraction of values held by format contexts during the postprocessing stage of determining the format specification (typically performed by the FormatSpecificationParser). This type exists so that FormatSpecificationParser can update FormatterSpecificationNumericValue to the value contained by a Standard basic_format_arg using the Standard visit_format_arg function.

See bslfmt_formatterspecificationnumericvalue

Public Member Functions

 FormatterSpecificationNumericValue_ArgVisitor (FormatterSpecificationNumericValue *valuePtr)
 
void operator() (bsl::monostate) const
 
void operator() (bool) const
 
template<class t_TYPE >
bsl::enable_if< bsl::is_integral< t_TYPE >::value >::type operator() (t_TYPE value) const
 
template<class t_TYPE >
bsl::enable_if<!bsl::is_integral< t_TYPE >::value >::type operator() (t_TYPE value) const
 

Constructor & Destructor Documentation

◆ FormatterSpecificationNumericValue_ArgVisitor()

bslfmt::FormatterSpecificationNumericValue_ArgVisitor::FormatterSpecificationNumericValue_ArgVisitor ( FormatterSpecificationNumericValue valuePtr)
inline

Create an instance of FormatterSpecificationNumericValue_ArgVisitor that refers to the object to which the specified valuePtr points.

Member Function Documentation

◆ operator()() [1/4]

void bslfmt::FormatterSpecificationNumericValue_ArgVisitor::operator() ( bool  ) const
inline

Throw an exception of type format_error . This indicates visitation of a bsl::format argument of boolean type, usually resulting from a user error such as calling bsl::format("{:{}}", value, b) where b is bool.

◆ operator()() [2/4]

void bslfmt::FormatterSpecificationNumericValue_ArgVisitor::operator() ( bsl::monostate  ) const
inline

Throw an exception of type format_error . This indicates visitation of an argument with no value, which would indicate a logic error.

Note
Note that this would only be called when extracting a value from a basic_format_arg that holds no value, which would normally indicate an incorrect argument type.

◆ operator()() [3/4]

template<class t_TYPE >
bsl::enable_if<!bsl::is_integral< t_TYPE >::value >::type bslfmt::FormatterSpecificationNumericValue_ArgVisitor::operator() ( t_TYPE  value) const

Update the FormatterSpecificationNumericValue referenced by this visitor by setting its category attribute to e_VALUE and its value to the specified value.

◆ operator()() [4/4]

template<class t_TYPE >
bsl::enable_if<!bsl::is_integral< t_TYPE >::value >::type bslfmt::FormatterSpecificationNumericValue_ArgVisitor::operator() ( t_TYPE  value) const

Throw an exception of type format_error . This indicates visitation of a bsl::format argument of non-integral type, usually resulting from a user error such as calling bsl::format("{:{}}", value, f) where f has a floating point type.


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