PartitionParse(ReadOnlySpanChar, IFormatProvider) Method

Parses a span of characters into a Partition class.

Definition

Namespace: Ookii.AnswerFile
Assembly: Ookii.AnswerFile (in Ookii.AnswerFile.dll) Version: 2.1.0+446b05628b4ec6933ca1b84b1f778ac43fb60ce9
C#
public static Partition Parse(
	ReadOnlySpan<char> s,
	IFormatProvider? provider
)

Parameters

s  ReadOnlySpanChar
The span of characters to parse.
provider  IFormatProvider
An object that provides culture-specific formatting information about s.

Return Value

Partition
The result of parsing s.

Implements

ISpanParsableTSelfParse(ReadOnlySpanChar, IFormatProvider)

Remarks

The input must use the format "size", "label:size", "size[fs]" or "label:size[fs]", where "label" is the volume label, "size" is a value using multiple-byte units, and "fs" is the name of a supported file system such as "FAT32" or "NTFS". Examples are "Windows:128GB" and "Data:16GB[FAT32]"

Instead of an explicit size, you can use "*" for the size to indicate the partition should be extended to fill the remaining space on the disk. For example, "Windows:*".

Certain volume labels are treated specially, and can be used to create special partition types. "System" creates a partition with PartitionTypeSystem, "MSR" with PartitionTypeMsr, and "WinRE" and "Recovery" with PartitionTypeUtility. This check is case insensitive, and all other volume labels create a partition with PartitionTypeNormal.

Exceptions

FormatExceptions is not in the correct format.
OverflowExceptions contains a partition size that is not representable as a BinarySize.

See Also