Struct TextLine
Information about the character boundaries of a single line of text.
Implements
IEquatable<TextLine>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Loretta.CodeAnalysis.Text
Assembly: Loretta.CodeAnalysis.dll
Syntax
public readonly struct TextLine
Properties
| Improve this Doc View SourceEnd
Gets the end position of the line not including the line break.
Declaration
public readonly int End { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
EndIncludingLineBreak
Gets the end position of the line including the line break.
Declaration
public readonly int EndIncludingLineBreak { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
LineNumber
Gets the zero-based line number.
Declaration
public readonly int LineNumber { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Span
Gets the line span not including the line break.
Declaration
public readonly TextSpan Span { get; }
Property Value
Type | Description |
---|---|
TextSpan |
SpanIncludingLineBreak
Gets the line span including the line break.
Declaration
public readonly TextSpan SpanIncludingLineBreak { get; }
Property Value
Type | Description |
---|---|
TextSpan |
Start
Gets the start position of the line.
Declaration
public readonly int Start { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Text
Gets the source text.
Declaration
public readonly SourceText Text { get; }
Property Value
Type | Description |
---|---|
SourceText |
Methods
| Improve this Doc View SourceEquals(TextLine)
Declaration
public readonly bool Equals(TextLine other)
Parameters
Type | Name | Description |
---|---|---|
TextLine | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Declaration
public override readonly bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
System.ValueType.Equals(System.Object)
|
Improve this Doc
View Source
FromSpan(SourceText, TextSpan)
Creates a TextLine instance.
Declaration
public static TextLine FromSpan(SourceText text, TextSpan span)
Parameters
Type | Name | Description |
---|---|---|
SourceText | text | The source text. |
TextSpan | span | The span of the line. |
Returns
Type | Description |
---|---|
TextLine | An instance of TextLine. |
GetHashCode()
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
System.ValueType.GetHashCode()
|
Improve this Doc
View Source
ToString()
Returns the text for this line.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.ValueType.ToString()
Operators
| Improve this Doc View SourceEquality(TextLine, TextLine)
Checks whether two text lines are equal.
Declaration
public static bool operator ==(TextLine left, TextLine right)
Parameters
Type | Name | Description |
---|---|---|
TextLine | left | |
TextLine | right |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(TextLine, TextLine)
Checks whether two text lines are not equal.
Declaration
public static bool operator !=(TextLine left, TextLine right)
Parameters
Type | Name | Description |
---|---|---|
TextLine | left | |
TextLine | right |
Returns
Type | Description |
---|---|
System.Boolean |
Implements
IEquatable<>