Table of Contents

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 CsvRecord<T>, Exception)

Initializes a new instance of CsvExceptionHandlerArgs<T>.

public CsvExceptionHandlerArgs(in CsvRecord<T> record, Exception exception)

Parameters

record CsvRecord<T>
exception Exception

Remarks

This constructor is included for testing only.

Properties

Exception

Exception thrown.

public Exception Exception { get; }

Property Value

Exception

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

int

Header

Returns the header record, or empty if no headers in CSV.

public ImmutableArray<string> Header { get; }

Property Value

ImmutableArray<string>

Line

1-based line number.

public int Line { get; }

Property Value

int

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

long

RawRecord

The current CSV record (unescaped/untrimmed).

public ReadOnlySpan<T> RawRecord { 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

index int

0-based field index

raw bool

Don't unescape the value

Returns

ReadOnlySpan<T>

Value of the field