legalize library

Checks for/sanitizes illegal characters in file names.

For Windows systems use the dedicated functions. For other systems use the generic functions.

Functions

containsControlCharacters(String filename) bool
Checks if the filename contains a control character.
containsIllegalFATCharacters(String filename) bool
Checks if the filename contains illegal FAT characters.
containsIllegalHFSCharacters(String filename) bool
Checks if the filename contains illegal HFS characters.
containsIllegalPosixCharacters(String filename) bool
Checks if the filename contains illegal Posix characters.
containsIllegalWindowsCharacters(String filename) bool
Checks if the filename contains illegal Windows characters.
containsIllegalWindowsTrailingCharacters(String filename) bool
Checks if the filename contains illegal Windows trailing characters.
containsNullCharacter(String filename) bool
Checks if the filename contains a null character.
isLegalLength(String filename) bool
Checks if the filename is of valid length.
isRelativePath(String filename) bool
Checks if the filename is a relative path.
isReservedWindowsFilename(String filename) bool
Checks if the filename is a reserved Windows file name.
isValidFATFilename(String filename) bool
Checks if the filename is a valid FAT filename.
isValidFilename(String filename, {String? os}) bool
Checks if the filename is valid for a given system.
isValidHFSFilename(String filename) bool
Checks if the filename is a valid HFS filename.
isValidPosixFilename(String filename) bool
Checks if the filename is a valid Posix filename.
isValidUniversalFilename(String filename) bool
Checks if the filename is valid for all systems.
isValidWindowsFilename(String filename) bool
Checks if the filename is a valid Windows filename.
legalizeFATFilename(String filename, {String replacement = '_', String placeholder = 'untitled'}) String
Sanitizes the filename for FAT systems.
legalizeFilename(String filename, {String? os, String replacement = '_', String placeholder = 'untitled'}) String
Sanitizes the filename for a given system.
legalizeFilenameUniversal(String filename, {String replacement = '_', String placeholder = 'untitled'}) String
Sanitizes the filename for both Windows and Posix systems.
legalizeHFSFilename(String filename, {String replacement = '_', String placeholder = 'untitled', bool shouldReplaceControlCharacters = true}) String
Legalizes the filename for HFS systems.
legalizePosixFilename(String filename, {String replacement = '_', String placeholder = 'untitled', bool shouldReplaceControlCharacters = true}) String
Sanitizes the filename for Posix systems.
legalizeWindowsFilename(String filename, {String replacement = '_', String placeholder = 'untitled'}) String
Sanitizes the filename for Windows systems.