Function isValidDesktopFileKey

Test whether the string is valid key in terms of Desktop File Specification.

bool isValidDesktopFileKey (
  scope const(char)[] desktopKey
) pure nothrow @nogc @safe;

Not actually used in IniLikeFile, but can be used in derivatives. Only the characters A-Za-z0-9- may be used in key names.

Note

this function automatically separate key from locale. Locale is validated against isValidKey.

See Also

Basic format of the file, isValidKey

Example

assert(isValidDesktopFileKey("Generic-Name"));
assert(isValidDesktopFileKey("Generic-Name[ru_RU]"));
assert(!isValidDesktopFileKey("Name$"));
assert(!isValidDesktopFileKey(""));
assert(!isValidDesktopFileKey("[ru_RU]"));
assert(!isValidDesktopFileKey("Name[ru\nRU]"));