TomlSourceSpan Struct

Represents a textual source span within a TOML payload.

public readonly struct TomlSourceSpan

Constructors

NameDescription
TomlSourceSpan(string, TomlTextPosition, TomlTextPosition)Initializes a new instance of the TomlSourceSpan struct.

TomlSourceSpan(string, TomlTextPosition, TomlTextPosition)

TomlSourceSpan.cs

Initializes a new instance of the TomlSourceSpan struct.

public TomlSourceSpan(string sourceName, TomlTextPosition start, TomlTextPosition end)

Parameters

sourceName string
An optional source name (for example a file path).
start TomlTextPosition
The start position.
end TomlTextPosition
The end position.

Properties

NameDescription
EndGets the ending position.
LengthGets the length of this span (inclusive).
OffsetGets the starting offset of this span.
SourceNameGets the source name associated with this span (for example a file path).
StartGets the starting position.

Gets the ending position.

public TomlTextPosition End { get; }

Property value

TomlTextPosition

Gets the length of this span (inclusive).

public int Length { get; }

Property value

int

Gets the starting offset of this span.

public int Offset { get; }

Property value

int

Gets the source name associated with this span (for example a file path).

public string SourceName { get; }

Property value

string

Gets the starting position.

public TomlTextPosition Start { get; }

Property value

TomlTextPosition

Methods

NameDescription
ToString()Returns the fully qualified type name of this instance.
ToStringSimple()Returns a string representation of this source span not including the end position.

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string The fully qualified type name.

ToStringSimple()

TomlSourceSpan.cs

Returns a string representation of this source span not including the end position.

public string ToStringSimple()

Returns

string