Search Results for

    Show / Hide Table of Contents

    Struct LinePosition

    Immutable representation of a line number and position within a SourceText instance.

    Implements
    IEquatable<LinePosition>
    IComparable<LinePosition>
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    Namespace: Loretta.CodeAnalysis.Text
    Assembly: cs.temp.dll.dll
    Syntax
    public readonly struct LinePosition

    Constructors

    LinePosition(Int32, Int32)

    Initializes a new instance of a LinePosition with the given line and character.

    Declaration
    public LinePosition(int line, int character)
    Parameters
    Type Name Description
    System.Int32 line

    The line of the line position. The first line in a file is defined as line 0 (zero based line numbering).

    System.Int32 character

    The character position in the line.

    Properties

    Character

    The character position within the line.

    Declaration
    public readonly int Character { get; }
    Property Value
    Type Description
    System.Int32

    Line

    The line number. The first line in a file is defined as line 0 (zero based line numbering).

    Declaration
    public readonly int Line { get; }
    Property Value
    Type Description
    System.Int32

    Zero

    A LinePosition that represents position 0 at line 0.

    Declaration
    public static readonly LinePosition Zero { get; }
    Property Value
    Type Description
    LinePosition

    Methods

    CompareTo(LinePosition)

    Declaration
    public readonly int CompareTo(LinePosition other)
    Parameters
    Type Name Description
    LinePosition other
    Returns
    Type Description
    System.Int32

    Equals(LinePosition)

    Determines whether two LinePosition are the same.

    Declaration
    public readonly bool Equals(LinePosition other)
    Parameters
    Type Name Description
    LinePosition other

    The object to compare.

    Returns
    Type Description
    System.Boolean

    Equals(Object)

    Determines whether two LinePosition are the same.

    Declaration
    public override readonly bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The object to compare.

    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)

    GetHashCode()

    Provides a hash function for LinePosition.

    Declaration
    public override readonly int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    ToString()

    Provides a string representation for LinePosition.

    Declaration
    public override readonly string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.ValueType.ToString()
    Examples

    0,10

    Operators

    Equality(LinePosition, LinePosition)

    Determines whether two LinePosition are the same.

    Declaration
    public static bool operator ==(LinePosition left, LinePosition right)
    Parameters
    Type Name Description
    LinePosition left
    LinePosition right
    Returns
    Type Description
    System.Boolean

    GreaterThan(LinePosition, LinePosition)

    Checks whether one position is located after another.

    Declaration
    public static bool operator>(LinePosition left, LinePosition right)
    Parameters
    Type Name Description
    LinePosition left
    LinePosition right
    Returns
    Type Description
    System.Boolean

    GreaterThanOrEqual(LinePosition, LinePosition)

    Checks whether one position is located after or at the same location as another.

    Declaration
    public static bool operator >=(LinePosition left, LinePosition right)
    Parameters
    Type Name Description
    LinePosition left
    LinePosition right
    Returns
    Type Description
    System.Boolean

    Inequality(LinePosition, LinePosition)

    Determines whether two LinePosition are different.

    Declaration
    public static bool operator !=(LinePosition left, LinePosition right)
    Parameters
    Type Name Description
    LinePosition left
    LinePosition right
    Returns
    Type Description
    System.Boolean

    LessThan(LinePosition, LinePosition)

    Checks whether one position is located before another.

    Declaration
    public static bool operator <(LinePosition left, LinePosition right)
    Parameters
    Type Name Description
    LinePosition left
    LinePosition right
    Returns
    Type Description
    System.Boolean

    LessThanOrEqual(LinePosition, LinePosition)

    Checks whether one position is located before or at the same location as another.

    Declaration
    public static bool operator <=(LinePosition left, LinePosition right)
    Parameters
    Type Name Description
    LinePosition left
    LinePosition right
    Returns
    Type Description
    System.Boolean

    Implements

    IEquatable<>
    IComparable<>
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾