Class CsvHeader
- Namespace
- FlameCsv
- Assembly
- FlameCsv.Core.dll
Read-only CSV header record.
public sealed class CsvHeader : IEquatable<CsvHeader>
- Inheritance
-
objectCsvHeader
- Implements
Constructors
CsvHeader(CsvHeader)
Copy constructor for CsvHeader.
public CsvHeader(CsvHeader other)
Parameters
otherCsvHeader
CsvHeader(bool, ImmutableArray<string>)
Initializes a new instance of the CsvHeader class.
public CsvHeader(bool ignoreCase, ImmutableArray<string> header)
Parameters
ignoreCaseboolWhether to ignore case when comparing headers
headerImmutableArray<string>Header values
Properties
this[int]
Returns the header name at the specified index.
public string this[int index] { get; }
Parameters
indexint
Property Value
this[string]
Returns the index of the specified header name.
public int this[string headerName] { get; }
Parameters
headerNamestring
Property Value
Values
Returns the header values.
public ImmutableArray<string> Values { get; }
Property Value
Methods
ContainsKey(string)
Returns true if the specified header is present.
public bool ContainsKey(string key)
Parameters
keystringHeader name
Returns
Equals(CsvHeader?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(CsvHeader? other)
Parameters
otherCsvHeaderAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Parse<T>(CsvRecordRef<T>)
Parses fields as strings from the specified record.
public static ImmutableArray<string> Parse<T>(CsvRecordRef<T> record) where T : unmanaged, IBinaryInteger<T>
Parameters
recordCsvRecordRef<T>
Returns
Type Parameters
T
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
TryGetName(int, out string?)
Attempts to return the header name at the specified index.
public bool TryGetName(int index, out string? value)
Parameters
Returns
TryGetValue(string, out int)
Attempts to return the index of the specified header.
public bool TryGetValue(string key, out int value)