darg_plus.validators

Validate and parse config files.

Members

Functions

validate
void validate(bool isValid, lazy string msg = "must be greater than zero")

General validation function.

validateFileExists
void validateFileExists(in string file, lazy string msg = "cannot open file `%s`")

Validates that the files exist.

validateFileExtension
void validateFileExtension(in string file, lazy string msg = "expected one of %-(%s, %) but got %s")

Validates that the file has one of the allowed extensions.

validateFileWritable
void validateFileWritable(string file, lazy string msg = "cannot open file `%s` for writing: %s")

Validates that the file is writable.

validateFilesExist
void validateFilesExist(in string[] files, lazy string msg = "cannot open file `%s`")

Validates that the files exist.

validatePositive
void validatePositive(V value, lazy string msg = "must be greater than zero")

Validates that value is positive.

validateRangeNonNegativeAscending
void validateRangeNonNegativeAscending(in string rangeString, lazy string msg = "0 <= <from> < <to> must hold")

Validates that the values described by rangeString are non-negative and in ascending order. Validation is skipped if rangeString is null.

Manifest constants

validationErrorFormat
enum validationErrorFormat;

Basic format of validation error messages.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE file.

Authors

Arne Ludwig <arne.ludwig@posteo.de>