configy.Utils

Utilities used internally by the config parser.

Compile this library with -debug=ConfigFillerDebug to get verbose output. This can be achieved with debugVersions in dub, or by depending on the debug configuration provided by dub.json.

Members

Aliases

SinkType
alias SinkType = void delegate(in char[]) @(safe)

Type of sink used by the toString

Functions

dbgWrite
void dbgWrite(string fmt, Args args)

A thin wrapper around stderr.writefln with indentation

dbgWrite
void dbgWrite(string fmt, Args args)

No-op

dbgWriteRet
T dbgWriteRet(T return_, string fmt, Args args)

Log a value that is to be returned The value will be the first argument and painted yellow

dbgWriteRet
T dbgWriteRet(T return_, string fmt, Args args)

No-op

paint
Colored!T paint(T arg, string color)

Thin wrapper to simplify colorization

paintBool
Colored!bool paintBool(bool value, bool reverse)

Paint a boolean in green if true, red otherwise, unless reverse is set to true, in which case the colors are swapped

paintIf
Colored!T paintIf(T arg, bool cond, string ifTrue, string ifFalse)

Paint arg in color ifTrue if cond evaluates to true, use color ifFalse otherwise

Structs

Colored
struct Colored(T)

Thin wrapper to simplify colorization

Variables

Cyan
auto Cyan;

Set the foreground color to green, used field names / path

Green
auto Green;

Set the foreground color to green, used for true, present, etc...

Red
auto Red;

Set the foreground color to red, used for false, missing, errors, etc...

Reset
auto Reset;

Reset the foreground color used

Yellow
auto Yellow;

Set the foreground color to red, used for warnings and other things that should draw attention but do not pose an immediate issue

indent
size_t indent;

The current indentation

Meta

License

MIT License. See LICENSE for details.