API Reference

Interface

ICsvFieldSpanVisitor

Namespace OfficeIMO.CSV
Assembly OfficeIMO.CSV
Modifiers abstract

Receives CSV fields as transient spans during a single-pass read.

Methods

public virtual Boolean TryVisitEscapedField(Int32 recordIndex, Int32 fieldIndex, ReadOnlySpan<Char> escapedValue, Int32 unescapedLength) #
Returns: Boolean

Optionally visits an escaped quoted field without forcing the parser to compact doubled quotes into a scratch buffer.

Parameters

recordIndex System.Int32 requiredposition: 0
Zero-based emitted record index.
fieldIndex System.Int32 requiredposition: 1
Zero-based field index within the record.
escapedValue System.ReadOnlySpan{System.Char} requiredposition: 2
The quoted field content without surrounding quotes, preserving doubled quote escape sequences.
unescapedLength System.Int32 requiredposition: 3
Length of the field after CSV quote unescaping.

Returns

true when the visitor consumed the escaped field; otherwise the parser falls back to Char>) with an unescaped span.

public abstract Void VisitField(Int32 recordIndex, Int32 fieldIndex, ReadOnlySpan<Char> value) #
Returns: Void

Visits one parsed field. The span is valid only for the duration of the call.

Parameters

recordIndex System.Int32 requiredposition: 0
Zero-based emitted record index.
fieldIndex System.Int32 requiredposition: 1
Zero-based field index within the record.
value System.ReadOnlySpan{System.Char} requiredposition: 2
The field value. Do not capture the span beyond this method.
public virtual Void VisitFieldValue(Int32 recordIndex, Int32 fieldIndex, String value) #
Returns: Void

Visits one parsed string field. Implement this to avoid copying fields that were already materialized while parsing quoted records.

Parameters

recordIndex System.Int32 requiredposition: 0
Zero-based emitted record index.
fieldIndex System.Int32 requiredposition: 1
Zero-based field index within the record.
value System.String requiredposition: 2
The field value.