Struct CsvExceptionHandlerArgs<T>
- Namespace
- FlameCsv
- Assembly
- FlameCsv.Core.dll
Arguments for CsvExceptionHandler<T>.
public readonly struct CsvExceptionHandlerArgs<T> where T : unmanaged, IBinaryInteger<T>
Type Parameters
T
Token type
Constructors
CsvExceptionHandlerArgs(in CsvFields<T>, ImmutableArray<string>, Exception, int, long)
Initializes a new instance of CsvExceptionHandlerArgs<T>.
public CsvExceptionHandlerArgs(in CsvFields<T> fields, ImmutableArray<string> header, Exception exception, int lineIndex, long position)
Parameters
Properties
Exception
Exception thrown.
public Exception Exception { get; }
Property Value
Remarks
CsvFormatException is unrecoverable, and not handled by the callback.
FieldCount
Gets the number of fields in the record.
public int FieldCount { get; }
Property Value
Fields
Returns the CsvFields<T> instance.
public CsvFields<T> Fields { get; }
Property Value
- CsvFields<T>
Remarks
The instance is only valid until the handler returns, and should not be stored for further use.
Header
Returns the header record, or empty if no headers in CSV.
public ImmutableArray<string> Header { get; }
Property Value
Line
1-based line number.
public int Line { get; }
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 record.
public long Position { get; }
Property Value
Record
The current CSV record (unescaped/untrimmed).
public ReadOnlySpan<T> Record { get; }
Property Value
- ReadOnlySpan<T>
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