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.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    Namespace: Loretta.CodeAnalysis
    Assembly: cs.temp.dll.dll
    Syntax
    public readonly struct FileLinePositionSpan

    Constructors

    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.

    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

    EndLinePosition

    Gets the of the end of the span.

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

    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.

    IsValid

    Returns true if the span represents a valid location.

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

    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.

    Span

    Gets the span.

    Declaration
    public readonly LinePositionSpan Span { get; }
    Property Value
    Type Description
    LinePositionSpan

    StartLinePosition

    Gets the of the start of the span.

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

    Methods

    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.

    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)

    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.

    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

    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

    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<>
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾