Table of Contents

Struct NewlineBuffer<T>

Namespace
FlameCsv
Assembly
FlameCsv.Core.dll

Internal implementation detail.

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

Type Parameters

T
Implements

Constructors

NewlineBuffer(T)

Initializes a 1-character newline.

public NewlineBuffer(T first)

Parameters

first T

Remarks

Does not validate the character's validity, see Validate().

NewlineBuffer(T, T)

Initializes a 2-character newline.

public NewlineBuffer(T first, T second)

Parameters

first T

First character

second T

Second character; must not be the same as first.

Remarks

Does not validate the character's validity, see Validate().

Fields

First

First character of the newline.

public readonly T First

Field Value

T

Length

Newline length.

public readonly int Length

Field Value

int

Second

Second character of the newline. If length is 1, this is the same as First.

public readonly T Second

Field Value

T

Properties

CRLF

Returns a newline buffer with length of 2 and value of \r\n.

public static NewlineBuffer<T> CRLF { get; }

Property Value

NewlineBuffer<T>

IsEmpty

Returns true if the newline is default; otherwise, false.

public bool IsEmpty { get; }

Property Value

bool

LF

Returns a newline buffer with length of 1 and value of \n.

public static NewlineBuffer<T> LF { get; }

Property Value

NewlineBuffer<T>

Methods

Equals(NewlineBuffer<T>)

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

public bool Equals(NewlineBuffer<T> other)

Parameters

other NewlineBuffer<T>

An object to compare with this object.

Returns

bool

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

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToArray()

Creates an array from the newline buffer.

public T[] ToArray()

Returns

T[]

Operators

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

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

Parameters

left NewlineBuffer<T>
right NewlineBuffer<T>

Returns

bool

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

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

Parameters

left NewlineBuffer<T>
right NewlineBuffer<T>

Returns

bool