Generator of exhaustive standard formatting‐specification combinations.

Synopsis

Declared in <bslfmt_testspecificationgenerator.h>

template<class t_CHAR>
class TestSpecificationGenerator;

Description

This class is a generator that provides a set of formatting specifications obtained by exhaustive search of all combinations of standard options. Its use allows easy and thorough testing of formatters for standard types. The generator is a state machine, each state of which corresponds to a separate specification.

Enums

Name

Description

Alignment

Alignment option values corresponding to format alignment characters.

FormatType

Format presentation types corresponding to standard format type chars.

NestedVariant

Nested width or precision argument‐id variants.

Sign

Sign option values corresponding to format sign characters.

Member Functions

Name

Description

TestSpecificationGenerator [constructor]

Create a generator object.

addFillCharacter

Add a fill character to the set used when generating specifications.

addPrecision

Add a precision value to the set used when generating specifications.

addWidth

Add a width value to the set used when generating specifications.

alignment

Return the current alignment type.

fillCharacter

Return the current fill character.

formatSpec

Return the current generated format specification string.

isAlignOptionPresent

Return true if the align option is present in the current state of this object, and false otherwise.

isFillCharacterPresent

Return true if the fill character is present in the current state of this object, and false otherwise.

isHashOptionPresent

Return true if the alternative form option is present in the current state of this object, and false otherwise.

isLocaleOptionPresent

Return true if the locale option is present in the current state of this object, and false otherwise.

isNestedPrecisionPresent

Return true if the nested precision option is present in the current state of this object, and false otherwise.

isNestedWidthPresent

Return true if the nested width option is present in the current state of this object, and false otherwise.

isPrecisionOptionPresent

Return true if the precision option is present in the current state of this object, and false otherwise.

isSignOptionPresent

Return true if the sign option is present in the current state of this object, and false otherwise.

isStateValidForFormat

Return true if the generated specification based on the current state of this object is valid for the formatters format method, and false otherwise.

isStateValidForParse

Return true if the generated specification based on the current state of this object is valid for the formatters parse method, and false otherwise.

isTypeOptionPresent

Return true if the presentation type option is present in the current state of this object, and false otherwise.

isValueIdOptionPresent

Return true if the value id option is present in the current state of this object, and false otherwise.

isWidthOptionPresent

Return true if the width option is present in the current state of this object, and false otherwise.

isZeroOptionPresent

Return true if the zero option is present in the current state of this object, and false otherwise.

nestedPrecisionVariant

Return the current nested precision variant.

nestedWidthVariant

Return the current nested width variant.

next

Switch this object to the next state and generate specification based on the new state.

nextValidForFormat

Advance to the next state that yields a specification valid for format.

nextValidForParse

Advance to the next state that yields a specification valid for parse.

precision

Return the current precision value.

setup

Configure the generator state sequence from an option instruction.

sign

Return the current sign option value.

spec

Return the specification for the formatters parse method based on the current state of this object.

type

Return the current presentation type value.

width

Return the current width value.

operator BloombergLP::bslmf::NestedTraitDeclaration<TestSpecificationGenerator, UsesBslmaAllocator>

Declare TestSpecificationGenerator as using bslma allocator.

Created with MrDocs