|
BDE 4.39.x Production Release
|
#include <bslfmt_formatterspecificationnumericvalue.h>
Type holding a category plus an optional integral value. This is a value semantic type primarily used to represent width and precision of a format specification.
Public Types | |
| enum | Category { e_DEFAULT , e_VALUE , e_NEXT_ARG , e_ARG_ID } |
Public Member Functions | |
| BSLS_KEYWORD_CONSTEXPR_CPP20 | FormatterSpecificationNumericValue () |
| BSLS_KEYWORD_CONSTEXPR_CPP20 | FormatterSpecificationNumericValue (Category category, int value) |
| template<class t_ITER > | |
| void BSLS_KEYWORD_CONSTEXPR_CPP20 | parse (t_ITER *start, t_ITER end, bool needInitialDot) |
| template<typename t_FORMAT_CONTEXT > | |
| void | postprocess (const t_FORMAT_CONTEXT &context) |
| BSLS_KEYWORD_CONSTEXPR_CPP20 bool | operator== (const FormatterSpecificationNumericValue &other) const |
| BSLS_KEYWORD_CONSTEXPR_CPP20 Category | category () const |
| BSLS_KEYWORD_CONSTEXPR_CPP20 int | value () const |
| template<class t_ITER > | |
| BSLS_KEYWORD_CONSTEXPR_CPP20 void | parse (t_ITER *start, t_ITER end, bool needInitialDot) |
Friends | |
| class | FormatterSpecificationNumericValue_ArgVisitor |
|
inline |
Create a FormatterSpecificationNumericValue object with e_DEFAULT category and 0 value.
|
inline |
Create a FormatterSpecificationNumericValue object with the specified value and category attributes.
|
inline |
Return the category attribute of this object.
|
inline |
Return true if this object is equal to the specified other object, otherwise return false. Two FormatterSpecificationNumericValue objects are considered equal if their category and value attributes are both equal.
| void BSLS_KEYWORD_CONSTEXPR_CPP20 bslfmt::FormatterSpecificationNumericValue::parse | ( | t_ITER * | start, |
| t_ITER | end, | ||
| bool | needInitialDot | ||
| ) |
Parse the string in the random-access-iterator range specified by start and end to extract either a hard-coded integer or a nested argument specification. If the specified needInitialDot is true the string is only parsed if ‘*start == ’.'and a @ref format_error exception is thrown if the string following the initial dot is empty. If an error occurs throw an exception of type @ref format_error , otherwise update the outputstart` iterator to point to the first unparsed character of the string and store the parsed result into this object.
| BSLS_KEYWORD_CONSTEXPR_CPP20 void bslfmt::FormatterSpecificationNumericValue::parse | ( | t_ITER * | start, |
| t_ITER | end, | ||
| bool | needInitialDot | ||
| ) |
|
inline |
If this object holds a non-dynamic nested value (i.e., d_type is e_ARG_ID) update its value using the arguments stored in the specified context and update the type to e_VALUE. If this object holds a dynamic nested value (i.e., d_type is e_NEXT_ARG) throw an exception of type format_error . Otherwise do nothing.
|
inline |
Return the value attribute of this object.
category is either e_DEFAULT or e_NEXT_ARG_ID.
|
friend |