Table of Contents

Struct CsvFields<T>

Namespace
FlameCsv.Reading
Assembly
FlameCsv.Core.dll

Contains the fields of a single CSV record.

[DebuggerDisplay("{ToString(),nq}")]
[DebuggerTypeProxy(typeof(CsvFields<>.CsvLineDebugView))]
public readonly struct CsvFields<T> : ICsvFields<T> where T : unmanaged, IBinaryInteger<T>

Type Parameters

T
Implements

Properties

FieldCount

Number of fields in the record.

public int FieldCount { get; }

Property Value

int

Record

Data of the raw record, not including possible trailing newline.

public ReadOnlyMemory<T> Record { get; }

Property Value

ReadOnlyMemory<T>

Methods

GetEnumerator()

Returns an enumerator that iterates over the fields in the record.

public CsvFields<T>.Enumerator GetEnumerator()

Returns

CsvFields<T>.Enumerator

GetField(int, bool, Span<T>)

Returns the value of a field.

public ReadOnlySpan<T> GetField(int index, bool raw = false, Span<T> buffer = default)

Parameters

index int

Zero-based field index

raw bool

Whether to return the field unescaped

buffer Span<T>

Optional buffer to use when unescaping fields with embedded quotes/escapes

Returns

ReadOnlySpan<T>

The field value

Exceptions

ArgumentOutOfRangeException

If index is out of range

See Also

GetRecordLength(bool)

Returns length of the raw record.

public int GetRecordLength(bool includeTrailingNewline = false)

Parameters

includeTrailingNewline bool

Returns

int

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.