semitwist.util.mixins

Undocumented in source.

Members

Aliases

_semitwist_traceVal_writefln
alias _semitwist_traceVal_writefln = writefln

A DRY way to display an expression and its value to Stdout.

Functions

_genEnumToString
string _genEnumToString(string enumName, string[] enumValues)
Undocumented in source. Be warned that the author may not have intended to support it.
_genStringToEnum
string _genStringToEnum(string enumName, string[] enumValues)
Undocumented in source. Be warned that the author may not have intended to support it.
_semitwist_traceVal_stdout_flush
void _semitwist_traceVal_stdout_flush()
Undocumented in source. Be warned that the author may not have intended to support it.
fixAATypeName
string fixAATypeName(string str)

Part of a workaround for DMD Issues #5029 and #5030

genEnum
string genEnum(string name, string[] values)

OBSOLETE IN D2

initFrom
string initFrom(string from, string[] vars)
Undocumented in source. Be warned that the author may not have intended to support it.
initMember
string initMember(string[] vars)

Useful in constructors for DRY.

initMemberFrom
string initMemberFrom(string from, string[] vars)

Useful in copy constructors for DRY.

initMemberTo
string initMemberTo(string to, string[] vars)
Undocumented in source. Be warned that the author may not have intended to support it.
initMemberX
string initMemberX(string str, string[] vars)

Generic version of initMember.

trace
void trace(string msg)

Easy way to output file/line for debugging.

Imports

_semitwist_util_mixins_StopWatchType (from std.datetime)
public import std.datetime : _semitwist_util_mixins_StopWatchType = StopWatch;
Undocumented in source.
_semitwist_util_mixins_stdout (from std.stdio)
public import std.stdio : _semitwist_util_mixins_write = write, _semitwist_util_mixins_writeln = writeln, _semitwist_util_mixins_stdout = stdout;
Undocumented in source.
_semitwist_util_mixins_write (from std.stdio)
public import std.stdio : _semitwist_util_mixins_write = write, _semitwist_util_mixins_writeln = writeln, _semitwist_util_mixins_stdout = stdout;
Undocumented in source.
_semitwist_util_mixins_writeln (from std.stdio)
public import std.stdio : _semitwist_util_mixins_write = write, _semitwist_util_mixins_writeln = writeln, _semitwist_util_mixins_stdout = stdout;
Undocumented in source.

Templates

getter
template getter(varType, string name, varType initialValue = varType.init)

Useful in class/struct declarations for DRY.

getter
template getter(string writeAccess, varType, string name, varType initialValue = varType.init)
Undocumented in source.
getterLazy
template getterLazy(varType, string name, string genFunc = "")

Similar to "getter", but for values that are to be lazily generated and cached. This is useful for values that are complex to generate, not always used, and either never or infrequently change.

getterLazy
template getterLazy(string writeAccess, varType, string name, string genFunc = "")
Undocumented in source.
setVerboseSectionCond
template setVerboseSectionCond(string cond = "verbose")

Use verboseSection to display a message, flush it to the screen, and once the scope is over, display how much time the scope took to run. Message and timing info is only displayed when verbosity is enabled. Condition for "Is verbosity enabled?" can be customized with setVerboseSectionCond.

traceMixin
template traceMixin(string name, string args)

Wraps a string mixin and displays the string at compile-time. Useful for debugging.

traceVal
template traceVal(values...)
Undocumented in source.
traceVal
template traceVal(bool useNewline, values...)
Undocumented in source.
traceValCT
template traceValCT(values...)

Compile-time version of traceVal.

traceValCT
template traceValCT(bool useNewline, values...)
Undocumented in source.
verboseSection
template verboseSection(alias msg)

Use verboseSection to display a message, flush it to the screen, and once the scope is over, display how much time the scope took to run. Message and timing info is only displayed when verbosity is enabled. Condition for "Is verbosity enabled?" can be customized with setVerboseSectionCond.

verboseSectionEx
template verboseSectionEx(string verboseExpr, alias msg)
Undocumented in source.

Meta