C# Класс Microsoft.CodeAnalysis.Sarif.NewLineIndex

An index of newline start locations in a string in order to relatively cheaply turn a given offset into a line / column number.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetLineInfoForLine ( int lineNumber ) : LineInfo

Gets a LineInfo for the line at the specified index.

GetLineInfoForOffset ( int offset ) : LineInfo

Gets line information for the line containing the character at the specified offset.

GetOffsetInfoForOffset ( int offset ) : OffsetInfo

Gets information for a given offset, such as the line and column numbers.

Приватные методы

Метод Описание
NewLineIndex ( string textToIndex ) : System

Описание методов

GetLineInfoForLine() публичный Метод

Gets a LineInfo for the line at the specified index.
Thrown when is not /// a valid line number; e.g. if it is zero, negative, or greater than the maximum line count in /// the file.
public GetLineInfoForLine ( int lineNumber ) : LineInfo
lineNumber int The line number.
Результат LineInfo

GetLineInfoForOffset() публичный Метод

Gets line information for the line containing the character at the specified offset.
Thrown when is negative.
public GetLineInfoForOffset ( int offset ) : LineInfo
offset int The offset.
Результат LineInfo

GetOffsetInfoForOffset() публичный Метод

Gets information for a given offset, such as the line and column numbers.
Thrown when is negative.
public GetOffsetInfoForOffset ( int offset ) : OffsetInfo
offset int The offset for which information shall be obtained.
Результат OffsetInfo