Class CsvTypeMapEnumerator<T, TValue>
- Namespace
- FlameCsv.Enumeration
- Assembly
- FlameCsv.Core.dll
An enumerator that parses CSV records as TValue
.
public sealed class CsvTypeMapEnumerator<T, TValue> : CsvValueEnumeratorBase<T, TValue>, IEnumerator<TValue>, IEnumerator, IDisposable, IAsyncEnumerator<TValue>, IAsyncDisposable where T : unmanaged, IBinaryInteger<T>
Type Parameters
T
TValue
- Inheritance
-
CsvValueEnumeratorBase<T, TValue>CsvTypeMapEnumerator<T, TValue>
- Implements
-
IEnumerator<TValue>IAsyncEnumerator<TValue>
- Inherited Members
Remarks
If the options are configured to read a header record, it will be processed first before any records are yielded.
This class is not thread-safe, and should not be used concurrently.
The enumerator should always be disposed after use, either explicitly or using foreach
.
Constructors
CsvTypeMapEnumerator(CsvOptions<T>, CsvTypeMap<T, TValue>, ICsvPipeReader<T>, CancellationToken)
Initializes a new instance of CsvValueEnumerator<T, TValue>.
public CsvTypeMapEnumerator(CsvOptions<T> options, CsvTypeMap<T, TValue> typeMap, ICsvPipeReader<T> reader, CancellationToken cancellationToken = default)
Parameters
options
CsvOptions<T>Options to use for reading
typeMap
CsvTypeMap<T, TValue>Type map used for binding
reader
ICsvPipeReader<T>Data source
cancellationToken
CancellationTokenToken to cancel asynchronous enumeration
Methods
BindToHeaderless()
Returns a materializer bound to field indexes.
protected override IMaterializer<T, TValue> BindToHeaderless()
Returns
- IMaterializer<T, TValue>
BindToHeaders(ReadOnlySpan<string>)
Returns a materializer bound to headers
.
protected override IMaterializer<T, TValue> BindToHeaders(ReadOnlySpan<string> headers)
Parameters
headers
ReadOnlySpan<string>
Returns
- IMaterializer<T, TValue>