lu.conv

This module contains functions that in one way or another converts its arguments into something else.

Credit for Enum goes to Stephan Koch (https://github.com/UplinkCoder).

Members

Functions

numFromHex
void numFromHex(string hexString, int r, int g, int b, Flag!"acceptLowercase" acceptLowercase)

Convenience wrapper that takes a hex string and maps the values to three integers passed by ref.

numFromHex
uint numFromHex(string hex, Flag!"acceptLowercase" acceptLowercase)

Returns the decimal value of a hex number in string form.

toAlpha
string toAlpha(Num num)

Translates an integer into an alphanumeric string. Assumes ASCII. Overload that returns the string.

toAlphaInto
void toAlphaInto(Num num, Sink sink)

Translates an integer into an alphanumeric string. Assumes ASCII. Overload that takes an output range sink.

Templates

Enum
template Enum(E)

Template housing optimised functions to get the string name of an enum member, or the enum member of a name string.

Examples

enum SomeEnum { one, two, three };

SomeEnum foo = Enum!SomeEnum.fromString("one");
SomeEnum bar = Enum!SomeEnum.fromString("three");

assert(foo == SomeEnum.one);
assert(bar == SomeEnum.three);

Meta