SourceSpan Struct

A span of text.

public struct SourceSpan : IEquatable<SourceSpan>
Implements

Constructors

NameDescription
SourceSpan(int, int)Initializes a new instance of the SourceSpan struct.

SourceSpan(int, int)

SourceSpan.cs

Initializes a new instance of the SourceSpan struct.

public SourceSpan(int start, int end)

Parameters

start int
The start.
end int
The end.

Properties

NameDescription
EndGets or sets the ending character position from the original text source. Note that for inline elements, this is only valid if MarkdownExtensions.UsePreciseSourceLocation is setup on the pipeline.
IsEmptyGets or sets the is empty.
LengthGets the character length of this element within the original source code.
StartGets or sets the starting character position from the original text source. Note that for inline elements, this is only valid if MarkdownExtensions.UsePreciseSourceLocation is setup on the pipeline.

Gets or sets the ending character position from the original text source. Note that for inline elements, this is only valid if MarkdownExtensions.UsePreciseSourceLocation is setup on the pipeline.

public int End { readonly get; set; }

Property value

int

Gets or sets the is empty.

public readonly bool IsEmpty { get; }

Property value

bool

Gets the character length of this element within the original source code.

public readonly int Length { get; }

Property value

int

Gets or sets the starting character position from the original text source. Note that for inline elements, this is only valid if MarkdownExtensions.UsePreciseSourceLocation is setup on the pipeline.

public int Start { readonly get; set; }

Property value

int

Methods

NameDescription
Equals(SourceSpan)Performs the equals operation.
Equals(object?)Performs the equals operation.
GetHashCode()Gets hash code.
MoveForward(int)Performs the move forward operation.
ToString()Performs the to string operation.

Equals overloads

Equals(SourceSpan)

SourceSpan.cs

Performs the equals operation.

public readonly bool Equals(SourceSpan other)
Parameters
other SourceSpan
Returns

bool

Equals(object?)

SourceSpan.cs

Performs the equals operation.

public override readonly bool Equals(object? obj)
Parameters
obj object?
Returns

bool

GetHashCode()

SourceSpan.cs

Gets hash code.

public override readonly int GetHashCode()

Returns

int

MoveForward(int)

SourceSpan.cs

Performs the move forward operation.

public SourceSpan MoveForward(int count)

Parameters

count int

Returns

SourceSpan

ToString()

SourceSpan.cs

Performs the to string operation.

public override readonly string ToString()

Returns

string

Operators

NameDescription
operator ==(SourceSpan, SourceSpan)Performs the operation.
operator !=(SourceSpan, SourceSpan)Performs the operation.

operator ==(SourceSpan, SourceSpan)

SourceSpan.cs

Performs the operation.

public static bool operator ==(SourceSpan left, SourceSpan right)

Parameters

left SourceSpan
right SourceSpan

Returns

bool

operator !=(SourceSpan, SourceSpan)

SourceSpan.cs

Performs the operation.

public static bool operator !=(SourceSpan left, SourceSpan right)

Parameters

left SourceSpan
right SourceSpan

Returns

bool

Fields

NameDescription
EmptyGets or sets the empty.

Empty

Gets or sets the empty.

public static readonly SourceSpan Empty