IniLikeGroup.validateValue

Validate value for key before setting value to key for this group and throw exception if not valid. Can be reimplemented in derived classes.

Default implementation checks if value is escaped.

class IniLikeGroup
protected @trusted const
void
validateValue
(
string key
,
string value
)

Parameters

key string

key the value is being set to.

value string

value to validate. Considered to be escaped.

Throws

IniLikeEntryException if value is invalid.

Examples

auto ilf = new IniLikeFile();
ilf.addGenericGroup("Group");

auto entryException = collectException!IniLikeEntryException(ilf.group("Group")["Key"] = "New\nline");
assert(entryException !is null);
assert(entryException.key == "Key");
assert(entryException.value == "New\nline");

See Also

Meta