[#BloombergLP-bslfmt-FormatSpecificationParser] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslfmt.adoc[bslfmt]::FormatSpecificationParser :relfileprefix: ../../ :mrdocs: 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. == Synopsis Declared in `<bslfmt_formatspecificationparser.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_CHAR> class FormatSpecificationParser : public xref:BloombergLP/bslfmt/FormatSpecificationParserEnums.adoc[FormatSpecificationParserEnums] ---- == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bslfmt/FormatSpecificationParserEnums.adoc[FormatSpecificationParserEnums]` | Namespace struct holding enums used for parsing. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslfmt/FormatSpecificationParserEnums/Alignment.adoc[`Alignment`] | Alignment options parsed from a format specification. | xref:BloombergLP/bslfmt/FormatSpecificationParserEnums/ProcessingState.adoc[`ProcessingState`] | Parser processing states for a format specification. | xref:BloombergLP/bslfmt/FormatSpecificationParserEnums/Sections.adoc[`Sections`] | Bit flags indicating which format‐spec sections were parsed. | xref:BloombergLP/bslfmt/FormatSpecificationParserEnums/Sign.adoc[`Sign`] | Sign options parsed from a format specification. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslfmt/FormatSpecificationParser/2constructor.adoc[`FormatSpecificationParser`] [.small]#[constructor]# | Create a default instance of `FormatSpecificationParser`. | xref:BloombergLP/bslfmt/FormatSpecificationParser/alignment.adoc[`alignment`] | Return the stored alignment value. If `parse` has not previously been called throw a `format_error` exception. | xref:BloombergLP/bslfmt/FormatSpecificationParser/alternativeFlag.adoc[`alternativeFlag`] | 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. | xref:BloombergLP/bslfmt/FormatSpecificationParser/filler.adoc[`filler`] | Return the stored filler string. If `parse` has not previously been called throw a `format_error` exception. | xref:BloombergLP/bslfmt/FormatSpecificationParser/fillerCodePointDisplayWidth.adoc[`fillerCodePointDisplayWidth`] | Return the width of the filler code point. If `postprocess` has not previously been called throw a `format_error` exception. | xref:BloombergLP/bslfmt/FormatSpecificationParser/localeSpecificFlag.adoc[`localeSpecificFlag`] | 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. | xref:BloombergLP/bslfmt/FormatSpecificationParser/numFillerCharacters.adoc[`numFillerCharacters`] | Return the size of the stored filler string. If `parse` has not previously been called throw a `format_error` exception. | xref:BloombergLP/bslfmt/FormatSpecificationParser/parse.adoc[`parse`] | 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. | xref:BloombergLP/bslfmt/FormatSpecificationParser/postprocess.adoc[`postprocess`] | 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. | xref:BloombergLP/bslfmt/FormatSpecificationParser/postprocessedPrecision.adoc[`postprocessedPrecision`] | Return the modified numeric precision extracted during postprocessing. If `postprocess` has not previously been called throw a `format_error` exception. | xref:BloombergLP/bslfmt/FormatSpecificationParser/postprocessedWidth.adoc[`postprocessedWidth`] | Return the modified numeric width extracted during postprocessing. If `postprocess` has not previously been called throw a `format_error` exception. | xref:BloombergLP/bslfmt/FormatSpecificationParser/processingState.adoc[`processingState`] | Return the current processing state of this parser. | xref:BloombergLP/bslfmt/FormatSpecificationParser/rawPrecision.adoc[`rawPrecision`] | Return the unmodified precision extracted during parsing. If `parse` has not previously been called throw a `format_error` exception. | xref:BloombergLP/bslfmt/FormatSpecificationParser/rawWidth.adoc[`rawWidth`] | Return the unmodified width extracted during parsing. If `parse` has not previously been called throw a `format_error` exception. | xref:BloombergLP/bslfmt/FormatSpecificationParser/remainingSpec.adoc[`remainingSpec`] | Return that section of the specification string that remains unparsed after the call to `parse`. Note that this may be a truncated version of the string held by the parse context. If `parse` has not previously been called throw a `format_error` exception. | xref:BloombergLP/bslfmt/FormatSpecificationParser/sign.adoc[`sign`] | Return the stored sign value. If `parse` has not previously been called throw a `format_error` exception. | xref:BloombergLP/bslfmt/FormatSpecificationParser/zeroPaddingFlag.adoc[`zeroPaddingFlag`] | 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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#