Search Results for

    Show / Hide Table of Contents

    Struct FileLinePositionSpan

    Represents a span of text in a source code file in terms of file name, line number, and offset within line. However, the file is actually whatever was passed in when asked to parse; there may not really be a file.

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

    Constructors

    | Improve this Doc View Source

    FileLinePositionSpan(String, LinePosition, LinePosition)

    Initializes the FileLinePositionSpan instance.

    Declaration
    public FileLinePositionSpan(string path, LinePosition start, LinePosition end)
    Parameters
    Type Name Description
    System.String path

    The file identifier - typically a relative or absolute path.

    LinePosition start

    The start line position.

    LinePosition end

    The end line position.

    | Improve this Doc View Source

    FileLinePositionSpan(String, LinePositionSpan)

    Initializes the FileLinePositionSpan instance.

    Declaration
    public FileLinePositionSpan(string path, LinePositionSpan span)
    Parameters
    Type Name Description
    System.String path

    The file identifier - typically a relative or absolute path.

    LinePositionSpan span

    The span.

    Properties

    | Improve this Doc View Source

    EndLinePosition

    Gets the LinePosition of the end of the span.

    Declaration
    public readonly LinePosition EndLinePosition { get; }
    Property Value
    Type Description
    LinePosition
    | Improve this Doc View Source

    HasMappedPath

    True if the Path is a mapped path.

    Declaration
    public readonly bool HasMappedPath { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    A mapped path is a path specified in source via #line (C#) or #ExternalSource (VB) directives.

    | Improve this Doc View Source

    IsValid

    Returns true if the span represents a valid location.

    Declaration
    public readonly bool IsValid { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Path

    Path, or null if the span represents an invalid value.

    Declaration
    public readonly string Path { get; }
    Property Value
    Type Description
    System.String
    Remarks

    Path may be System.String.Empty if not available.

    | Improve this Doc View Source

    Span

    Gets the span.

    Declaration
    public readonly LinePositionSpan Span { get; }
    Property Value
    Type Description
    LinePositionSpan
    | Improve this Doc View Source

    StartLinePosition

    Gets the LinePosition of the start of the span.

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

    Methods

    | Improve this Doc View Source

    Equals(FileLinePositionSpan)

    Determines if two FileLinePositionSpan objects are equal.

    Declaration
    public readonly bool Equals(FileLinePositionSpan other)
    Parameters
    Type Name Description
    FileLinePositionSpan other
    Returns
    Type Description
    System.Boolean
    Remarks

    The path is treated as an opaque string, i.e. a case-sensitive comparison is used.

    | Improve this Doc View Source

    Equals(Object)

    Determines if two FileLinePositionSpan objects are equal.

    Declaration
    public override readonly bool Equals(object other)
    Parameters
    Type Name Description
    System.Object other
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)
    | Improve this Doc View Source

    GetHashCode()

    Serves as a hash function for FileLinePositionSpan.

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

    The hash code.

    Overrides
    System.ValueType.GetHashCode()
    Remarks

    The path is treated as an opaque string, i.e. a case-sensitive hash is calculated.

    | Improve this Doc View Source

    ToString()

    Returns a System.String that represents FileLinePositionSpan.

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

    The string representation of FileLinePositionSpan.

    Overrides
    System.ValueType.ToString()
    Examples

    Path: (0,0)-(5,6)

    Operators

    | Improve this Doc View Source

    Equality(FileLinePositionSpan, FileLinePositionSpan)

    Checks whether two spans are equal.

    Declaration
    public static bool operator ==(FileLinePositionSpan left, FileLinePositionSpan right)
    Parameters
    Type Name Description
    FileLinePositionSpan left
    FileLinePositionSpan right
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Inequality(FileLinePositionSpan, FileLinePositionSpan)

    Checks whether two spans are not equal.

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

    Implements

    IEquatable<>
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾