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. The key is provided because you may want to implement specific checks depending on the key name.

Default implementation checks if value is escaped. It does not check the key in any way.

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

Examples

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

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

See Also

Meta