ensure

Provides some convenience functionality for parsing command-line arguments by piggy-backing off std.getopt.

Members

Classes

EnsureException
class EnsureException

Thrown for any validation errors.

Enums

isNullable
eponymoustemplate isNullable(T)

Tests if a type can null. Not related to std.typecons.Nullable!T.

nameof
eponymoustemplate nameof(alias symbol)

A convenience wrapper for __traits( identifier, ... ).

Functions

between
Arg!N between(Arg!N arg, N lowerBound, N upperBound)

Ensures that a number is between an upper bound and a lower bound.

ensure
Arg!(typeof(what)) ensure()

Wrap a function argument to perform validation.

isNotEmpty
Arg!T isNotEmpty(Arg!T arg)

Ensures that an array is not empty.

isNotEmpty
Arg!T isNotEmpty(Arg!T arg)

Ensures that a range is not empty.

isNotNull
Arg!T isNotNull(Arg!T arg)

Ensures that the argument is not null.

isNotWhitespace
Arg!S isNotWhitespace(Arg!S arg)

Ensures that a string does not contain only whitespace characters.

Structs

Arg
struct Arg(T)

Represents a single function parameter, including name and value, upon which all validation is performed.

Meta

Authors

Tony J. Hudgins