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
other
CsvHeader
CsvHeader(IEqualityComparer<string>, ImmutableArray<string>)
Initializes a new instance of the CsvHeader class.
public CsvHeader(IEqualityComparer<string> comparer, ImmutableArray<string> header)
Parameters
comparer
IEqualityComparer<string>Comparer to use
header
ImmutableArray<string>Header values
Properties
Comparer
The comparer used to compare header values.
public IEqualityComparer<string> Comparer { get; }
Property Value
HeaderPool
Contains the string pool for header values.
[EditorBrowsable(EditorBrowsableState.Never)]
[CLSCompliant(false)]
public static StringPool HeaderPool { get; }
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
key
stringHeader name
Returns
Equals(CsvHeader?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(CsvHeader? other)
Parameters
other
CsvHeaderAn 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
obj
objectThe 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.
Get<T>(scoped ReadOnlySpan<T>, scoped Span<char>)
Retrieves a string representation of the given value using the provided options.
[EditorBrowsable(EditorBrowsableState.Advanced)]
public static string Get<T>(scoped ReadOnlySpan<T> value, scoped Span<char> buffer) where T : unmanaged, IBinaryInteger<T>
Parameters
value
ReadOnlySpan<T>The header field.
buffer
Span<char>A buffer to write the characters to.
Returns
- string
A string representation of the value. The value is pooled in HeaderPool if the chars fit in the buffer.
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.
TryGetValue(string, out int)
Attempts to return the index of the specified header.
public bool TryGetValue(string key, out int value)