[#BloombergLP-bslfmt-StandardFormatSpecification] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslfmt.adoc[bslfmt]::StandardFormatSpecification :relfileprefix: ../../ :mrdocs: A general mechanism to parse and validate a Standard format specification string for a given argument type. == Synopsis Declared in `<bslfmt_standardformatspecification.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_CHAR> class StandardFormatSpecification : 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/StandardFormatSpecification/Category.adoc[`Category`] | Format category enumeration. | xref:BloombergLP/bslfmt/StandardFormatSpecification/FormatType-01.adoc[`FormatType`] | Format type enumeration. | 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/StandardFormatSpecification/2constructor.adoc[`StandardFormatSpecification`] [.small]#[constructor]# | Create an uninitialized `StandardFormatSpecification` object. | xref:BloombergLP/bslfmt/StandardFormatSpecification/alignment.adoc[`alignment`] | Return the enumerator representing the requested alignment unless the status is not at least `e_STATE_PARSED` in which case throw a `bsl::format_error` exception indicating that error. | xref:BloombergLP/bslfmt/StandardFormatSpecification/alternativeFlag.adoc[`alternativeFlag`] | Return a boolean indicating if alternative formatting was requested unless the status is not at least `e_STATE_PARSED` in which case throw a `bsl::format_error` exception indicating that error. | xref:BloombergLP/bslfmt/StandardFormatSpecification/filler.adoc[`filler`] | Return a pointer to the character array that stores the parsed filler character that may be a multibyte code point or just a single character unless the status is not `e_STATE_PARSED` or `e_STATE_POSTPROCESSED` in which case throw a `bsl::format_error` exception indicating that error. See also `numFillerCharacters()` that provides the number of characters in the array returned by this function (at least one). | xref:BloombergLP/bslfmt/StandardFormatSpecification/fillerCodePointDisplayWidth.adoc[`fillerCodePointDisplayWidth`] | Return the display width of the code point represented by the array returned by `filler()` unless the status is not `e_STATE_PARSED` or `e_STATE_POSTPROCESSED` in which case throw a `bsl::format_error` exception indicating that error. | xref:BloombergLP/bslfmt/StandardFormatSpecification/formatType-0a.adoc[`formatType`] | Return the enumerator representing the requested format type unless the status is not at least `e_STATE_PARSED` in which case throw a `bsl::format_error` exception indicating that error. | xref:BloombergLP/bslfmt/StandardFormatSpecification/localeSpecificFlag.adoc[`localeSpecificFlag`] | Return a boolean indicating if the locale specific flag was present in the format specification unless the status is not at least `e_STATE_PARSED` in which case throw a `bsl::format_error` exception indicating that error. Note that the locale specific flag is not yet supported hence the attempt to format with a specification that has this flags set will result in an exception indicating that. | xref:BloombergLP/bslfmt/StandardFormatSpecification/numFillerCharacters.adoc[`numFillerCharacters`] | Return the number of filler characters in the array returned by `filler()` unless the status is not `e_STATE_PARSED` or `e_STATE_POSTPROCESSED` in which case throw a `bsl::format_error` exception indicating that error. | xref:BloombergLP/bslfmt/StandardFormatSpecification/parse.adoc[`parse`] | Parse a format string using the iterator‐range from the specified `context` assuming it is a Standard format specification for arguments of the specified `category` and if successful update this object with the parsing result, as well as set the status to `e_PARSED`; otherwise, if the format specification denoted by the `context` iterator‐range is not a valid Standard format specification for arguments of category `category` throw a `bsl::format_error` exception. | xref:BloombergLP/bslfmt/StandardFormatSpecification/postprocess.adoc[`postprocess`] | Update the corresponding attributes of this object using the argument values provided by the specified `context` to fill in the values of nested width or precision parameters if such nested parameters exist and set the status of this object to `e_STATE_POSTPROCESSED`. By nested format parameters we mean parameters whose value comes from an argument to the formatter function, and not an literal integer value within the format string. In case of an error throw a `bsl::format_error` exception. | xref:BloombergLP/bslfmt/StandardFormatSpecification/postprocessedPrecision.adoc[`postprocessedPrecision`] | Return an optional value representing the requested precision unless the status is not `e_STATE_POSTPROCESSED` in which case throw a `bsl::format_error` exception indicating that error. Note that the returned type is capable of representing more than just an optional integer, but after preprocessing it will have only two possible states: no value, or an integer value. | xref:BloombergLP/bslfmt/StandardFormatSpecification/postprocessedWidth.adoc[`postprocessedWidth`] | Return an optional value representing the requested width unless the status is not `e_STATE_POSTPROCESSED` in which case throw a `bsl::format_error` exception indicating that error. Note that the returned type is capable of representing more than just an optional integer, but after preprocessing it will have only two possible states: no value, or an integer value. | xref:BloombergLP/bslfmt/StandardFormatSpecification/processingState.adoc[`processingState`] | Return the current processing state of this specification. | xref:BloombergLP/bslfmt/StandardFormatSpecification/sign.adoc[`sign`] | Return the enumerator representing the requested sign‐treatment option unless the status is not at least `e_STATE_PARSED` in which case throw a `bsl::format_error` exception indicating that error. | xref:BloombergLP/bslfmt/StandardFormatSpecification/zeroPaddingFlag.adoc[`zeroPaddingFlag`] | Return a boolean indicating if zero padding was requested unless the status is not at least `e_STATE_PARSED` in which case throw a `bsl::format_error` exception indicating that error. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#