TextPosition Struct
A position within a text (offset, line column)
public struct TextPosition : IEquatable<TextPosition>- Implements
Constructors
| Name | Description |
|---|---|
| TextPosition(int, int, int) | Creates a new instance of a TextPosition |
TextPosition(int, int, int)
TextPosition.csProperties
| Name | Description |
|---|---|
| Column | Gets or sets the column number (zero based) |
| Line | Gets or sets the line number (zero based) |
| Offset | Gets or sets the offset. |
Column
TextPosition.csLine
TextPosition.csOffset
TextPosition.csMethods
| Name | Description |
|---|---|
| Equals(TextPosition) | 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(TextPosition)
TextPosition.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(TextPosition other)Parameters
otherTextPosition- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
TextPosition.csGetHashCode()
TextPosition.csToString()
TextPosition.csOperators
| Name | Description |
|---|---|
| operator ==(TextPosition, TextPosition) | Compares two TextPosition values for equality. |
| operator !=(TextPosition, TextPosition) | Compares two TextPosition values for inequality. |
operator ==(TextPosition, TextPosition)
TextPosition.csCompares two TextPosition values for equality.
public static bool operator ==(TextPosition left, TextPosition right)Parameters
leftTextPosition- The left value.
rightTextPosition- The right value.
Returns
bool true if the values are equal; otherwise false.
operator !=(TextPosition, TextPosition)
TextPosition.csCompares two TextPosition values for inequality.
public static bool operator !=(TextPosition left, TextPosition right)Parameters
leftTextPosition- The left value.
rightTextPosition- The right value.
Returns
bool true if the values are not equal; otherwise false.
Fields
| Name | Description |
|---|---|
| Eof | Gets a sentinel position representing end-of-file. |
Eof
Gets a sentinel position representing end-of-file.
public static readonly TextPosition Eof