Creates a new FormatSpec.
Set to DYNAMIC when the separator character is supplied at runtime.
Provides a string representation.
Writes a string representation to an output range.
Writes the format string to an output range until the next format specifier is found and parse that format specifier.
Special value for width, precision and separators.
Special value for precision and separators.
The separator charactar is supplied at runtime.
The format specifier contained a '-'.
The format specifier contained a '='.
The format specifier contained a '#'.
The format specifier contained a '+'.
The format specifier contained a ','.
The format specifier contained a space.
The format specifier contained a '0'.
Index of the last argument for positional parameter ranges.
Index of the argument for positional parameters.
Sequence ":" inserted between element key and element value of an associative array.
The inner format string of a nested format specifier.
Precision. Its semantic depends on the format character.
The separator of a nested format specifier.
Character to use as separator.
Number of elements between separators.
Sequence "]" inserted after each range or range like structure.
Sequence "[" inserted before each range or range like structure.
Sequence ", " inserted between elements of a range, a range like structure or the elements of an associative array.
The format character.
Contains the part of the format string, that has not yet been parsed.
Minimum width.
the character type of the format string
import std.array : appender; auto a = appender!(string)(); auto fmt = "Number: %6.4e\nString: %s"; auto f = FormatSpec!char(fmt); assert(f.writeUpToNextSpec(a)); assert(a.data == "Number: "); assert(f.trailing == "\nString: %s"); assert(f.spec == 'e'); assert(f.width == 6); assert(f.precision == 4); assert(f.writeUpToNextSpec(a)); assert(a.data == "Number: \nString: "); assert(f.trailing == ""); assert(f.spec == 's'); assert(!f.writeUpToNextSpec(a)); assert(a.data == "Number: \nString: ");
A general handler for format strings.
This handler centers around the function writeUpToNextSpec, which parses the format string until the next format specifier is found. After the call, it provides information about this format specifier in its numerous variables.