Class CsvRecordEnumerable<T>
- Namespace
- FlameCsv.Enumeration
- Assembly
- FlameCsv.Core.dll
Enumerates known data into CSV records.
public sealed class CsvRecordEnumerable<T> : IEnumerable<CsvValueRecord<T>>, IEnumerable, IAsyncEnumerable<CsvValueRecord<T>> where T : unmanaged, IBinaryInteger<T>
Type Parameters
T
Token type
- Inheritance
-
CsvRecordEnumerable<T>
- Implements
Remarks
This type does not support Parallel or most LINQ operators.
Constructors
CsvRecordEnumerable(ICsvPipeReader<T>, CsvOptions<T>)
Creates a new instance that can be used to read CSV records.
public CsvRecordEnumerable(ICsvPipeReader<T> reader, CsvOptions<T> options)
Parameters
reader
ICsvPipeReader<T>options
CsvOptions<T>
CsvRecordEnumerable(in ReadOnlySequence<T>, CsvOptions<T>)
Creates a new instance that can be used to read CSV records.
public CsvRecordEnumerable(in ReadOnlySequence<T> csv, CsvOptions<T> options)
Parameters
csv
ReadOnlySequence<T>options
CsvOptions<T>
CsvRecordEnumerable(ReadOnlyMemory<T>, CsvOptions<T>)
Creates a new instance that can be used to read CSV records.
public CsvRecordEnumerable(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 CsvRecordEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA CancellationToken that may be used to cancel the asynchronous iteration.
Returns
- CsvRecordEnumerator<T>
An enumerator that can be used to iterate asynchronously through the collection.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public CsvRecordEnumerator<T> GetEnumerator()
Returns
- CsvRecordEnumerator<T>
An enumerator that can be used to iterate through the collection.
Preserve()
Copies the data in the records so they can be safely accessed after enumeration.
public IEnumerable<CsvRecord<T>> Preserve()
Returns
- IEnumerable<CsvRecord<T>>
PreserveAsync(CancellationToken)
Copies the data in the records so they can be safely accessed after enumeration.
public IAsyncEnumerable<CsvRecord<T>> PreserveAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken