|
BDE 4.39.x Production Release
|
#include <bslfmt_formatspecificationparser.h>
A general mechanism used in format specification parsers. It supports parsing syntaxes of the form fill-and-align?sign # 0 width?precision?L and any syntax that contains a subset of the sections therein.
Additional Inherited Members | |
Public Types inherited from bslfmt::FormatSpecificationParserEnums | |
| enum | ProcessingState { e_STATE_UNPARSED , e_STATE_PARSED , e_STATE_POSTPROCESSED } |
| enum | Alignment { e_ALIGN_DEFAULT , e_ALIGN_LEFT , e_ALIGN_MIDDLE , e_ALIGN_RIGHT } |
| enum | Sign { e_SIGN_DEFAULT , e_SIGN_POSITIVE , e_SIGN_NEGATIVE , e_SIGN_SPACE } |
| enum | Sections { e_SECTIONS_NONE = 0 , e_SECTIONS_FILL_ALIGN = 1 , e_SECTIONS_SIGN_FLAG = 2 , e_SECTIONS_ALTERNATE_FLAG = 4 , e_SECTIONS_ZERO_PAD_FLAG = 8 , e_SECTIONS_WIDTH = 16 , e_SECTIONS_PRECISION = 32 , e_SECTIONS_LOCALE_FLAG = 64 , e_SECTIONS_REMAINING_SPEC = 128 , e_SECTIONS_ALL = 256 - 1 } |
| BSLS_KEYWORD_CONSTEXPR_CPP20 bslfmt::FormatSpecificationParser< t_CHAR >::FormatSpecificationParser | ( | ) |
Create a default instance of FormatSpecificationParser.
| BSLS_KEYWORD_CONSTEXPR_CPP20 FormatSpecificationParser< t_CHAR >::Alignment bslfmt::FormatSpecificationParser< t_CHAR >::alignment | ( | ) | const |
Return the stored alignment value. If parse has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 bool bslfmt::FormatSpecificationParser< t_CHAR >::alternativeFlag | ( | ) | const |
Return true if parsing detected an alternative processing flag in the specification, otherwise return false. If parse has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 const t_CHAR * bslfmt::FormatSpecificationParser< t_CHAR >::filler | ( | ) | const |
Return the stored filler string. If parse has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 int bslfmt::FormatSpecificationParser< t_CHAR >::fillerCodePointDisplayWidth | ( | ) | const |
Return the width of the filler code point. If postprocess has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 bool bslfmt::FormatSpecificationParser< t_CHAR >::localeSpecificFlag | ( | ) | const |
Return true if parsing detected a locale-specific formatting flag in the specification, otherwise return false. If parse has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 int bslfmt::FormatSpecificationParser< t_CHAR >::numFillerCharacters | ( | ) | const |
Return the size of the stored filler string. If parse has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 void bslfmt::FormatSpecificationParser< t_CHAR >::parse | ( | t_PARSE_CONTEXT * | parseContext, |
| Sections | sections | ||
| ) |
Parse the string contained by the specified input/output parseContext to extract the items indicated by the specified sections, update this object with the parsing result and update the iterator held by parseContext to point to the start of the unparsed section of the string. In the event of an error throw a format_error exception.
| void bslfmt::FormatSpecificationParser< t_CHAR >::postprocess | ( | const t_FORMAT_CONTEXT & | context | ) |
Update any nested width and precision values to contain actual values based on the appropriate arguments held by the specified context format context. In the event of an error throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 const FormatterSpecificationNumericValue bslfmt::FormatSpecificationParser< t_CHAR >::postprocessedPrecision | ( | ) | const |
Return the modified numeric precision extracted during postprocessing. If postprocess has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 const FormatterSpecificationNumericValue bslfmt::FormatSpecificationParser< t_CHAR >::postprocessedWidth | ( | ) | const |
Return the modified numeric width extracted during postprocessing. If postprocess has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 FormatSpecificationParserEnums::ProcessingState bslfmt::FormatSpecificationParser< t_CHAR >::processingState | ( | ) | const |
Return the current processing state of this parser.
Return that section of the specification string parsed during the call to parse.
parse has not previously been called throw a format_error exception. | BSLS_KEYWORD_CONSTEXPR_CPP20 const FormatterSpecificationNumericValue bslfmt::FormatSpecificationParser< t_CHAR >::rawPrecision | ( | ) | const |
Return the unmodified precision extracted during parsing. If parse has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 const FormatterSpecificationNumericValue bslfmt::FormatSpecificationParser< t_CHAR >::rawWidth | ( | ) | const |
Return the unmodified width extracted during parsing. If parse has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 const bsl::basic_string_view< t_CHAR > bslfmt::FormatSpecificationParser< t_CHAR >::remainingSpec | ( | ) | const |
Return that section of the specification string that remains unparsed after the call to parse.
parse has not previously been called throw a format_error exception. | BSLS_KEYWORD_CONSTEXPR_CPP20 FormatSpecificationParser< t_CHAR >::Sign bslfmt::FormatSpecificationParser< t_CHAR >::sign | ( | ) | const |
Return the stored sign value. If parse has not previously been called throw a format_error exception.
| BSLS_KEYWORD_CONSTEXPR_CPP20 bool bslfmt::FormatSpecificationParser< t_CHAR >::zeroPaddingFlag | ( | ) | const |
Return true if parsing detected a zero padding flag in the specification, otherwise return false. If parse has not previously been called throw a format_error exception.