Table of Contents

Struct CsvExceptionHandlerArgs<T>

Namespace
FlameCsv
Assembly
FlameCsv.Core.dll

Arguments for CsvExceptionHandler<T>.

public readonly ref struct CsvExceptionHandlerArgs<T> where T : unmanaged, IBinaryInteger<T>

Type Parameters

T

Token type

Constructors

CsvExceptionHandlerArgs(ref readonly CsvFields<T>, ReadOnlySpan<string>, Exception, int, long)

Initializes a new instance of CsvExceptionHandlerArgs<T>.

public CsvExceptionHandlerArgs(ref readonly CsvFields<T> fields, ReadOnlySpan<string> header, Exception exception, int lineIndex, long position)

Parameters

fields CsvFields<T>
header ReadOnlySpan<string>
exception Exception
lineIndex int
position long

Properties

Exception

Exception thrown.

public Exception Exception { get; }

Property Value

Exception

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 ReadOnlySpan<string> Header { get; }

Property Value

ReadOnlySpan<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 unescaped record.

public long Position { get; }

Property Value

long

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

index int

0-based field index

raw bool

Don't unescape the value

Returns

ReadOnlySpan<T>

Value of the field