Table of Contents

Class CsvValueEnumerable<T, TValue>

Namespace
FlameCsv.Enumeration
Assembly
FlameCsv.Core.dll

Enumerable that can be used to read TValue using reflection.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public sealed class CsvValueEnumerable<T, TValue> : IEnumerable<TValue>, IEnumerable, ICsvValueAsyncEnumerable<T, TValue>, IAsyncEnumerable<TValue> where T : unmanaged, IBinaryInteger<T>

Type Parameters

T
TValue
Inheritance
CsvValueEnumerable<T, TValue>
Implements
IEnumerable<TValue>

Constructors

CsvValueEnumerable(ICsvPipeReader<T>, CsvOptions<T>)

Creates a new instance that can be used to read CSV records.

public CsvValueEnumerable(ICsvPipeReader<T> reader, CsvOptions<T> options)

Parameters

reader ICsvPipeReader<T>
options CsvOptions<T>

CsvValueEnumerable(in ReadOnlySequence<T>, CsvOptions<T>)

Creates a new instance that can be used to read CSV records.

public CsvValueEnumerable(in ReadOnlySequence<T> csv, CsvOptions<T> options)

Parameters

csv ReadOnlySequence<T>
options CsvOptions<T>

CsvValueEnumerable(ReadOnlyMemory<T>, CsvOptions<T>)

Creates a new instance that can be used to read CSV records.

public CsvValueEnumerable(ReadOnlyMemory<T> csv, CsvOptions<T> options)

Parameters

csv ReadOnlyMemory<T>
options CsvOptions<T>

Methods

GetAsyncEnumerator(CancellationToken)

Returns an enumerator that iterates asynchronously through the collection.

public CsvValueEnumerator<T, TValue> GetAsyncEnumerator(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A CancellationToken that may be used to cancel the asynchronous iteration.

Returns

CsvValueEnumerator<T, TValue>

An enumerator that can be used to iterate asynchronously through the collection.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public CsvValueEnumerator<T, TValue> GetEnumerator()

Returns

CsvValueEnumerator<T, TValue>

An enumerator that can be used to iterate through the collection.

WithExceptionHandler(CsvExceptionHandler<T>?)

Sets the exception handler for the enumerator. If the handler returns true, the exception is considered handled and the record is skipped.

public CsvValueEnumerable<T, TValue> WithExceptionHandler(CsvExceptionHandler<T>? handler)

Parameters

handler CsvExceptionHandler<T>

Exception handler. Set to null to remove an existing handler

Returns

CsvValueEnumerable<T, TValue>

The same enumerable instance