pub enum Category {
Show 26 variants
Text,
UpperCase,
LowerCase,
Integer,
DoubleInteger,
TimeDate,
Identifier,
Property,
Filename,
WildCardFilename,
Path,
Paths,
AnyPath,
DefaultDir,
RegPath,
Formatted,
FormattedSddlText,
Template,
Condition,
Guid,
Version,
Language,
Binary,
CustomSource,
Cabinet,
Shortcut,
}
Expand description
Indicates the format of a string-typed database column.
This list of categories comes from the column data types listed in the MSI docs.
Variants§
Text
An unrestricted text string.
For more details, see the MSI docs for this data type.
Examples
assert!(msi::Category::Text.validate("Hello, World!"));
UpperCase
A text string containing no lowercase letters.
For more details, see the MSI docs for this data type.
Examples
// Valid:
assert!(msi::Category::UpperCase.validate("HELLO, WORLD!"));
// Invalid:
assert!(!msi::Category::UpperCase.validate("Hello, World!"));
LowerCase
A text string containing no uppercase letters.
For more details, see the MSI docs for this data type.
Examples
// Valid:
assert!(msi::Category::LowerCase.validate("hello, world!"));
// Invalid:
assert!(!msi::Category::LowerCase.validate("Hello, World!"));
Integer
A signed 16-bit integer.
For more details, see the MSI docs for this data type.
Examples
// Valid:
assert!(msi::Category::Integer.validate("32767"));
assert!(msi::Category::Integer.validate("-47"));
// Invalid:
assert!(!msi::Category::Integer.validate("40000"));
DoubleInteger
A signed 32-bit integer.
For more details, see the MSI docs for this data type.
Examples
// Valid:
assert!(msi::Category::DoubleInteger.validate("2147483647"));
assert!(msi::Category::DoubleInteger.validate("-99999"));
// Invalid:
assert!(!msi::Category::DoubleInteger.validate("3000000000"));
TimeDate
Stores a civil datetime, with a 2-second resolution.
For more details, see the MSI docs for this data type.
Identifier
A string identifier (such as a table or column name). May only contain alphanumerics, underscores, and periods, and must start with a letter or underscore.
For more details, see the MSI docs for this data type.
Examples
// Valid:
assert!(msi::Category::Identifier.validate("HelloWorld"));
assert!(msi::Category::Identifier.validate("_99.Bottles"));
// Invalid:
assert!(!msi::Category::Identifier.validate("$HELLO"));
assert!(!msi::Category::Identifier.validate("3.14159"));
Property
A string that is either an identifier (see above), or a reference to an
environment variable (which consists of a %
character followed by an
identifier).
For more details, see the MSI docs for this data type.
Examples
// Valid:
assert!(msi::Category::Property.validate("HelloWorld"));
assert!(msi::Category::Property.validate("%HelloWorld"));
// Invalid:
assert!(!msi::Category::Property.validate("%"));
assert!(!msi::Category::Property.validate("Hello%World"));
Filename
The name of a file or directory.
For more details, see the MSI docs for this data type.
WildCardFilename
A filename that can contain shell glob wildcards.
For more details, see the MSI docs for this data type.
Path
A string containing an absolute filepath.
For more details, see the MSI docs for this data type.
Paths
A string containing a semicolon-separated list of absolute filepaths.
For more details, see the MSI docs for this data type.
AnyPath
A string containing an absolute or relative filepath.
For more details, see the MSI docs for this data type.
DefaultDir
A string containing either a filename or an identifier.
For more details, see the MSI docs for this data type.
RegPath
A string containing a registry path.
For more details, see the MSI docs for this data type.
Formatted
A string containing special formatting escapes, such as environment variables.
For more details, see the MSI docs for this data type.
FormattedSddlText
A security descriptor definition language (SDDL) text string written in valid Security Descriptor String Format.
For more details, see the MSI docs for this data type.
Template
Like Formatted
, but allows additional escapes.
For more details, see the MSI docs for this data type.
Condition
A string represeting a boolean predicate.
For more details, see the MSI docs for this data type.
Guid
A hyphenated, uppercase GUID string, enclosed in curly braces.
For more details, see the MSI docs for this data type.
Examples
// Valid:
assert!(msi::Category::Guid.validate(
"{34AB5C53-9B30-4E14-AEF0-2C1C7BA826C0}"));
// Invalid:
assert!(!msi::Category::Guid.validate(
"{34AB5C539B304E14AEF02C1C7BA826C0}")); // Must be hyphenated
assert!(!msi::Category::Guid.validate(
"{34ab5c53-9b30-4e14-aef0-2c1c7ba826c0}")); // Must be uppercase
assert!(!msi::Category::Guid.validate(
"34AB5C53-9B30-4E14-AEF0-2C1C7BA826C0")); // Must have braces
assert!(!msi::Category::Guid.validate(
"{HELLOWO-RLDH-ELLO-WORL-DHELLOWORLD0}"));
Version
A string containing a version number. The string must consist of at most four period-separated numbers, with the value of each number being at most 65535.
For more details, see the MSI docs for this data type.
Examples
// Valid:
assert!(msi::Category::Version.validate("1"));
assert!(msi::Category::Version.validate("1.22"));
assert!(msi::Category::Version.validate("1.22.3"));
assert!(msi::Category::Version.validate("1.22.3.444"));
// Invalid:
assert!(!msi::Category::Version.validate("1.99999"));
assert!(!msi::Category::Version.validate(".12"));
assert!(!msi::Category::Version.validate("1.2.3.4.5"));
Language
A string containing a comma-separated list of decimal language ID numbers.
For more details, see the MSI docs for this data type.
Examples
// Valid:
assert!(msi::Category::Language.validate("1033"));
assert!(msi::Category::Language.validate("1083,2107,3131"));
// Invalid:
assert!(!msi::Category::Language.validate(""));
assert!(!msi::Category::Language.validate("1083,2107,3131,"));
assert!(!msi::Category::Language.validate("1083,,3131"));
assert!(!msi::Category::Language.validate("en-US"));
Binary
A string that refers to a binary data stream.
For more details, see the MSI docs for this data type.
CustomSource
A string that refers to a custom source.
For more details, see the MSI docs for this data type.
Cabinet
A string that refers to a cabinet. If it starts with a #
character,
then the rest of the string is an identifier (see above) indicating a
data stream in the package where the cabinet is stored. Otherwise, the
string is a short filename (at most eight characters, a period, and a
three-character extension).
For more details, see the MSI docs for this data type.
Examples
// Valid:
assert!(msi::Category::Cabinet.validate("hello.txt"));
assert!(msi::Category::Cabinet.validate("#HelloWorld"));
// Invalid:
assert!(!msi::Category::Cabinet.validate("longfilename.long"));
assert!(!msi::Category::Cabinet.validate("#123.456"));
Shortcut
A string that refers to a shortcut.
For more details, see the MSI docs for this data type.