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
-
IEquatable<CsvDialect<T>>
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?
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
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
Trimming
Wheter to trim trailing or leading spaces from unquoted fields.
public CsvFieldTrimming Trimming { get; init; }
Property Value
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
Equals(object?)
Returns whether the parameter object is equal to this dialect.
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
Returns a hash code for the dialect.
public override int GetHashCode()
Returns
Validate()
Ensures that the dialect is valid, and has no problematic overlap in the tokens.
public void Validate()
Exceptions
Operators
operator ==(CsvDialect<T>, CsvDialect<T>)
public static bool operator ==(CsvDialect<T> left, CsvDialect<T> right)
Parameters
left
CsvDialect<T>right
CsvDialect<T>
Returns
operator !=(CsvDialect<T>, CsvDialect<T>)
public static bool operator !=(CsvDialect<T> left, CsvDialect<T> right)
Parameters
left
CsvDialect<T>right
CsvDialect<T>