Skip to content

SourceFilePosition<TSelf, TFile> Class ​

Definition ​

A SourcePosition in a source code file.

c#
public abstract class SourceFilePosition<TSelf, TFile> : SourcePosition<TSelf>, IEquatable<SourcePosition>, IEqualityOperators<SourcePosition, SourcePosition, Boolean>
   where TSelf : SourceFilePosition<TSelf, TFile>
   where TFile : SourceFile

View source

Type Parameters ​

NameDescription
TSelf
TFile

Constructors ​

NameDescription
SourceFilePosition(TFile, Int32, Int32)Initialises a new instance of the SourceFilePosition<TSelf, TFile> class.

Properties ​

NameDescription
EndIndexThe exclusive end index of the position in the source file.
FileThe SourceFile.
LengthThe length of the position in the source file.
StartIndexThe inclusive start index of the position in the source file.

Methods ​

NameDescription
Combine(TSelf)Combines two SourcePosition<TSelf>s to give a new SourcePosition that includes both this position and the other along any source in-between the two.
CreateCombination(TSelf)Creates a combination of this SourceFilePosition<TSelf, TFile> and another. Used to create a combination for Combine(TSelf).
Equals(SourcePosition)Indicates whether the current object is equal to another object of the same type.
GetHashCode()Serves as the default hash function.
Overlaps(SourceFilePosition<TSelf, TFile>)Returns true if two positions for the same file overlap. Zero length positions will overlap only if they are inside the other position. If they are at the start or end index of the other position they will not overlap. Two zero length positions never overlap.
ToString()Returns a string that represents the current object.