Class CsvConverter<T, TValue>
- Namespace
- FlameCsv
- Assembly
- FlameCsv.Core.dll
Parses and formats TValue
to/from CSV fields.
public abstract class CsvConverter<T, TValue> : CsvConverter<T> where T : unmanaged, IBinaryInteger<T>
Type Parameters
T
Token type
TValue
Parsed/formatted value
- Inheritance
-
CsvConverter<T>CsvConverter<T, TValue>
Properties
CanFormatNull
Whether the converter formats null values. When false (the default), GetNullToken(Type) is used to write nulls.
protected virtual bool CanFormatNull { get; }
Property Value
Methods
CanConvert(Type)
Returns whether the type can be handled by this converter.
public override bool CanConvert(Type type)
Parameters
type
TypeType to check
Returns
TryFormat(Span<T>, TValue, out int)
Attempts to format value
into the field.
public abstract bool TryFormat(Span<T> destination, TValue value, out int charsWritten)
Parameters
destination
Span<T>Buffer to format the value to
value
TValueValue to format
charsWritten
intIf successful, how many characters were written to
destination
Returns
TryParse(ReadOnlySpan<T>, out TValue)
Attempts to parse value
from the field.
public abstract bool TryParse(ReadOnlySpan<T> source, out TValue value)
Parameters
source
ReadOnlySpan<T>CSV field
value
TValueParsed value