A general handler for format strings.
This handler centers around the function
writeUpToNextSpec,which parses the
format string until thenext format specifier is found. After the call, it providesinformation about this format specifier in its numerous variables.
Minimum width.
Default:0.
Precision. Its semantic depends on the format character.
Number of elements between separators.
Default:UNSPECIFIED.
bool
dynamicSeparatorChar;
The separator charactar is supplied at runtime.
Default: false.
int
separatorCharPos();
void
separatorCharPos(int
value);
Set toDYNAMIC when the separator character is supplied at runtime.
Default:
UNSPECIFIED.
Warning:separatorCharPos is deprecated. It will be removed in 2.107.0. Please usedynamicSeparatorChar instead.Character to use as separator.
Default:','.
Special value forwidth,precision andseparators.
It flags that these values will be passed at runtime through variadic arguments.
Special value forprecision andseparators.
It flags that these values have not been specified.
The format character.
Default:'s'.
Index of the argument for positional parameters.
Counting starts with1. Set to0 if not used. Default:0.
Index of the last argument for positional parameter ranges.
Counting starts with
1. Set to
0 if not used. Default:
0.
The maximum value of this field is used as a sentinel to indicate the arguments' length.
The format specifier contained a'-'.
The format specifier contained a'0'.
The format specifier contained a space.
The format specifier contained a'+'.
The format specifier contained a'#'.
The format specifier contained a'='.
The format specifier contained a','.
The inner format string of a nested format specifier.
The separator of a nested format specifier.
null means, there is no separator.empty, but notnull, means zero length separator.
Contains the part of the format string, that has not yet been parsed.
enum immutable(Char)[]
seqBefore;
Sequence"[" inserted before each range or range like structure.
enum immutable(Char)[]
seqAfter;
Sequence"]" inserted after each range or range like structure.
enum immutable(Char)[]
keySeparator;
Sequence":" inserted between element key and element value of an associative array.
enum immutable(Char)[]
seqSeparator;
Sequence", " inserted between elements of a range, a range like structure or the elements of an associative array.
pure @safe this(in Char[]
fmt);
Creates a newFormatSpec.
The string is lazily evaluated. That means, nothing is done, until
writeUpToNextSpec is called.
bool
writeUpToNextSpec(OutputRange)(ref OutputRange
writer) scope;
Writes the format string to an output range until the next format specifier is found and parse that format specifier.
Parameters:OutputRangewriter | anoutput range, where the format string is written to |
| OutputRange | type of the output range |
Returns:True, if a format specifier is found and false, if the end of the format string has been reached.
pure @safe string
toString() const;
Provides a string representation.
Returns:The string representation.
void
toString(OutputRange)(ref OutputRange
writer) const
if (isOutputRange!(OutputRange, char));
Writes a string representation to an output range.
Parameters:OutputRangewriter | anoutput range, where the representation is written to |
| OutputRange | type of the output range |