Table of Contents

Struct CsvDialect<T>

Namespace
FlameCsv
Assembly
FlameCsv.Core.dll

Contains the token configuration for reading and writing CSV.

public readonly struct CsvDialect<T> : IEquatable<CsvDialect<T>> where T : unmanaged, IBinaryInteger<T>

Type Parameters

T

Token type

Implements

Remarks

Internal implementation detail.

Constructors

CsvDialect()

Contains the token configuration for reading and writing CSV.

public CsvDialect()

Remarks

Internal implementation detail.

See Also

Properties

Delimiter

The separator character between CSV fields.

public required T Delimiter { get; init; }

Property Value

T

Escape

Optional character used for escaping special characters.

public T? Escape { get; init; }

Property Value

T?

IsAscii

Determines if all tokens in the dialect are within ASCII range. This is a requirement for high performance SIMD vectorization. If false, this will have the same effect as setting NoReadAhead to false.

[EditorBrowsable(EditorBrowsableState.Advanced)]
public bool IsAscii { get; }

Property Value

bool

NeedsQuoting

Returns a SearchValues<T> instance that contains characters that require quotes around the CSV field.

public SearchValues<T> NeedsQuoting { get; init; }

Property Value

SearchValues<T>

Newline

1-2 characters long newline, or empty if newline is automatically detected.

public NewlineBuffer<T> Newline { get; init; }

Property Value

NewlineBuffer<T>

Remarks

If empty, the newline is \r\n when writing, and when validating the dialect.

Quote

Characted used to quote strings containing special characters.

public required T Quote { get; init; }

Property Value

T

Whitespace

Whitespace characters. When reading, they are trimmed out of each field before processing them. When writing, fields with the preceding or trailing whitespace are quoted if fields are automatically quoted.

public ReadOnlySpan<T> Whitespace { get; init; }

Property Value

ReadOnlySpan<T>

Methods

Equals(CsvDialect<T>)

Returns whether all tokens in the dialect are equal to the other dialect.

public bool Equals(CsvDialect<T> other)

Parameters

other CsvDialect<T>

Returns

bool

Equals(object?)

Returns whether the parameter object is equal to this dialect.

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

Returns a hash code for the dialect.

public override int GetHashCode()

Returns

int

Validate()

Ensures that the dialect is valid, and has no problematic overlap in the tokens.

public void Validate()

Exceptions

CsvConfigurationException

Operators

operator ==(CsvDialect<T>, CsvDialect<T>)

public static bool operator ==(CsvDialect<T> left, CsvDialect<T> right)

Parameters

left CsvDialect<T>
right CsvDialect<T>

Returns

bool

operator !=(CsvDialect<T>, CsvDialect<T>)

public static bool operator !=(CsvDialect<T> left, CsvDialect<T> right)

Parameters

left CsvDialect<T>
right CsvDialect<T>

Returns

bool

See Also