Class TabularTimeOnlyConverter
- Namespace
- Addax.Formats.Tabular.Converters
- Assembly
- Addax.Formats.Tabular.dll
Converts a TimeOnly value from or to a character sequence.
public class TabularTimeOnlyConverter : TabularConverter<TimeOnly>
- Inheritance
-
TabularTimeOnlyConverter
Constructors
TabularTimeOnlyConverter()
Initializes a new instance of the TabularTimeOnlyConverter class.
public TabularTimeOnlyConverter()
TabularTimeOnlyConverter(string?)
Initializes a new instance of the TabularTimeOnlyConverter class with the specified format.
protected TabularTimeOnlyConverter(string? format)
Parameters
formatstringA standard or custom time format string.
Methods
TryFormat(TimeOnly, Span<char>, IFormatProvider?, out int)
When overridden in a derived class, tries to format the value into a character sequence.
public override bool TryFormat(TimeOnly value, Span<char> destination, IFormatProvider? provider, out int charsWritten)
Parameters
valueTimeOnlyThe value to format.
destinationSpan<char>The buffer to write the value to.
providerIFormatProviderAn object that supplies culture-specific formatting information.
charsWrittenintWhen this method returns, contains an integer that is the number of characters that were written in
destination. This parameter is treated as uninitialized.
Returns
Remarks
Throws a NotSupportedException exception by default.
TryParse(ReadOnlySpan<char>, IFormatProvider?, out TimeOnly)
When overridden in a derived class, tries to parse the character sequence into a value.
public override bool TryParse(ReadOnlySpan<char> source, IFormatProvider? provider, out TimeOnly value)
Parameters
sourceReadOnlySpan<char>The buffer to read a value from.
providerIFormatProviderAn object that supplies culture-specific formatting information.
valueTimeOnlyWhen this method returns, contains a value that is the result of successfully parsing
source, or an undefined value on failure. This parameter is treated as uninitialized.
Returns
Remarks
Throws a NotSupportedException exception by default.