bc.string.format

Members

Aliases

Upper
alias Upper = Flag!"Upper"

Undocumented in source.

Functions

enumToStr
string enumToStr(E value)

Returns string of enum member value

formatDecimal
size_t formatDecimal(S sink, T val)

Undocumented in source. Be warned that the author may not have intended to support it.

formatDuration
size_t formatDuration(S sink, Duration val)

Formats duration. It uses custom formatter that is inspired by std.format output, but a bit shorter. Note: ISO 8601 was considered, but it's not as human readable as used format.

formatFloat
size_t formatFloat(S sink, double val)

Undocumented in source. Be warned that the author may not have intended to support it.

formatHex
size_t formatHex(S sink, ulong val)

Undocumented in source. Be warned that the author may not have intended to support it.

formatPtr
size_t formatPtr(S sink, ulong p)

Undocumented in source. Be warned that the author may not have intended to support it.

formatPtr
size_t formatPtr(S sink, void* ptr)

Undocumented in source. Be warned that the author may not have intended to support it.

formatSpec
auto formatSpec(FMT f, string spec)

Undocumented in source. Be warned that the author may not have intended to support it.

formatSysTime
size_t formatSysTime(S sink, SysTime val)

Formats SysTime as ISO extended string. Only UTC format supported.

formatUUID
size_t formatUUID(S sink, UUID val)

Undocumented in source. Be warned that the author may not have intended to support it.

getFormatSize
size_t getFormatSize(ARGS args)

Gets size needed to hold formatted string result

nogcFormat
const(char)[] nogcFormat(ARGS args)

Same as nogcFormatTo, but it internally uses static malloc buffer to write formatted string to. So be careful that next call replaces internal buffer data and previous result isn't valid anymore.

nogcFormatTo
size_t nogcFormatTo(S sink, ARGS args)

Formats values to with fmt template into provided sink. Note: it supports only a basic subset of format type specifiers, main usage is for nogc logging and error messages formatting. But more cases can be added as needed.

toChar
Char toChar(size_t i)

Undocumented in source. Be warned that the author may not have intended to support it.

Templates

splitFmt
template splitFmt(string fmt)

Splits format string based on the same rules as described here: https://dlang.org/phobos/std_format.html In addition it supports 'p' as a pointer format specifier to be more compatible with printf. It supports nested arrays format specifier too.

Meta