Struct CsvFields<T>
Contains the fields of a single CSV record.
[DebuggerDisplay("{ToString(),nq}")]
[DebuggerTypeProxy(typeof(CsvFields<>.CsvLineDebugView))]
public readonly struct CsvFields<T> : ICsvFields<T> where T : unmanaged, IBinaryInteger<T>
Type Parameters
T
- Implements
-
ICsvFields<T>
Properties
FieldCount
Number of fields in the record.
public int FieldCount { get; }
Property Value
Record
Data of the raw record, not including possible trailing newline.
public ReadOnlyMemory<T> Record { get; }
Property Value
Methods
GetEnumerator()
Returns an enumerator that iterates over the fields in the record.
public CsvFields<T>.Enumerator GetEnumerator()
Returns
GetField(int, bool, Span<T>)
Returns the value of a field.
public ReadOnlySpan<T> GetField(int index, bool raw = false, Span<T> buffer = default)
Parameters
index
intZero-based field index
raw
boolWhether to return the field unescaped
buffer
Span<T>Optional buffer to use when unescaping fields with embedded quotes/escapes
Returns
- ReadOnlySpan<T>
The field value
Exceptions
- ArgumentOutOfRangeException
If
index
is out of range
- See Also
GetRecordLength(bool)
Returns length of the raw record.
public int GetRecordLength(bool includeTrailingNewline = false)
Parameters
includeTrailingNewline
bool
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.