Class CsvReader.Enumerator
A forward-only cursor over a CsvReader source's records, reading either synchronously or asynchronously.
[SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "Public nested enumerator is the standard foreach pattern.")]
public sealed class CsvReader.Enumerator : PooledStreamRowEnumerator, IExcelRowEnumerator, IDisposable, IAsyncDisposable
- Inheritance
-
PooledStreamRowEnumeratorCsvReader.Enumerator
- Implements
- Inherited Members
Remarks
A single moving cursor (_pos) into a pooled buffer refilled/compacted via
ExcelReader.Core.Reader.Internal.BufferedStreamCursor. Most fields reference the buffer directly with no copy;
only fields needing unescaping materialize into the cell accumulator's value buffer.
Records parse from buffered bytes only — a partially-buffered record restarts after a
refill, so sync and async share one parser and async awaits once per refill, not per field.
Properties
Current
Gets the row at the enumerator's current position. Only valid after a call to MoveNext() or MoveNextAsync() has returned true.
public Row Current { get; }
Property Value
Methods
MoveNext()
Advances the enumerator to the next row, reading synchronously.
public bool MoveNext()
Returns
MoveNextAsync()
Advances the enumerator to the next row, reading asynchronously.
public ValueTask<bool> MoveNextAsync()