Struct CsvRecordCallbackArgs<T>
- Namespace
- FlameCsv
- Assembly
- FlameCsv.Core.dll
Arguments for CsvRecordCallback<T>.
public readonly ref struct CsvRecordCallbackArgs<T> where T : unmanaged, IBinaryInteger<T>
Type Parameters
T
Token type
Properties
FieldCount
Number of fields in the record.
public int FieldCount { get; }
Property Value
Header
Returns the header record if HeaderRead is true, empty otherwise.
public ReadOnlySpan<string> Header { get; }
Property Value
HeaderRead
Whether the header has been read. If this is set to false when the callback returns, the header is re-read.
public bool HeaderRead { get; set; }
Property Value
Remarks
If the set to false while reading headered CSV, this record will be considered the header unless SkipRecord is also true, in which case it will be first unskipped record.
IsEmpty
Returns true if the record has a length of 0.
public bool IsEmpty { get; }
Property Value
Remarks
An empty record's FieldCount is not zero, is considered to have exactly one field with length of 0.
Line
1-based line number.
public int Line { get; init; }
Property Value
Options
Options instance.
public CsvOptions<T> Options { get; }
Property Value
- CsvOptions<T>
Position
0-based character position in the data, measured from the start of the unescaped record.
public long Position { get; init; }
Property Value
Record
The current CSV record (unescaped/untrimmed).
public ReadOnlySpan<T> Record { get; }
Property Value
- ReadOnlySpan<T>
SkipRecord
Set to true to skip this record.
public bool SkipRecord { get; set; }
Property Value
Methods
GetField(int, bool)
Returns the value of a field.
public ReadOnlySpan<T> GetField(int index, bool raw = false)
Parameters
Returns
- ReadOnlySpan<T>
Value of the field