Table of Contents

Class CsvHeader

Namespace
FlameCsv
Assembly
FlameCsv.Core.dll

Read-only CSV header record.

public sealed class CsvHeader : IEquatable<CsvHeader>
Inheritance
object
CsvHeader
Implements

Constructors

CsvHeader(CsvHeader)

Copy constructor for CsvHeader.

public CsvHeader(CsvHeader other)

Parameters

other CsvHeader

CsvHeader(bool, ImmutableArray<string>)

Initializes a new instance of the CsvHeader class.

public CsvHeader(bool ignoreCase, ImmutableArray<string> header)

Parameters

ignoreCase bool

Whether to ignore case when comparing headers

header ImmutableArray<string>

Header values

Properties

this[int]

Returns the header name at the specified index.

public string this[int index] { get; }

Parameters

index int

Property Value

string

this[string]

Returns the index of the specified header name.

public int this[string headerName] { get; }

Parameters

headerName string

Property Value

int

Values

Returns the header values.

public ImmutableArray<string> Values { get; }

Property Value

ImmutableArray<string>

Methods

ContainsKey(string)

Returns true if the specified header is present.

public bool ContainsKey(string key)

Parameters

key string

Header name

Returns

bool

Equals(CsvHeader?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(CsvHeader? other)

Parameters

other CsvHeader

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

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

record CsvRecordRef<T>

Returns

ImmutableArray<string>

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

index int
value string

Returns

bool

TryGetValue(string, out int)

Attempts to return the index of the specified header.

public bool TryGetValue(string key, out int value)

Parameters

key string
value int

Returns

bool