TomlTextPosition Struct

Represents a position within a TOML payload (offset, line, column).

public readonly struct TomlTextPosition : IEquatable<TomlTextPosition>
Implements

Constructors

NameDescription
TomlTextPosition(int, int, int)Initializes a new instance of the TomlTextPosition struct.

TomlTextPosition(int, int, int)

TomlTextPosition.cs

Initializes a new instance of the TomlTextPosition struct.

public TomlTextPosition(int offset, int line, int column)

Parameters

offset int
The offset in the source text (0-based).
line int
The line number (0-based).
column int
The column number (0-based).

Properties

NameDescription
ColumnGets the column number (0-based).
LineGets the line number (0-based).
OffsetGets the offset in the source text (0-based).

Gets the column number (0-based).

public int Column { get; }

Property value

int

Gets the line number (0-based).

public int Line { get; }

Property value

int

Gets the offset in the source text (0-based).

public int Offset { get; }

Property value

int

Methods

NameDescription
Equals(TomlTextPosition)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
GetHashCode()Returns the hash code for this instance.
ToString()Returns the fully qualified type name of this instance.

Equals overloads

Equals(TomlTextPosition)

TomlTextPosition.cs

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

public bool Equals(TomlTextPosition other)
Parameters
other TomlTextPosition
An object to compare with this object.
Returns

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

Equals(object?)

TomlTextPosition.cs

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()

TomlTextPosition.cs

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.

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string The fully qualified type name.

Operators

NameDescription
operator ==(TomlTextPosition, TomlTextPosition)Compares two TomlTextPosition values for equality.
operator !=(TomlTextPosition, TomlTextPosition)Compares two TomlTextPosition values for inequality.

operator ==(TomlTextPosition, TomlTextPosition)

TomlTextPosition.cs

Compares two TomlTextPosition values for equality.

public static bool operator ==(TomlTextPosition left, TomlTextPosition right)

Parameters

left TomlTextPosition
right TomlTextPosition

Returns

bool

operator !=(TomlTextPosition, TomlTextPosition)

TomlTextPosition.cs

Compares two TomlTextPosition values for inequality.

public static bool operator !=(TomlTextPosition left, TomlTextPosition right)

Parameters

left TomlTextPosition
right TomlTextPosition

Returns

bool

Fields

NameDescription
EofGets a sentinel position representing end-of-file.

Eof

Gets a sentinel position representing end-of-file.

public static readonly TomlTextPosition Eof